Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: default to action model in HasActions trait #4844

Merged
merged 1 commit into from Nov 5, 2022

Conversation

awcodes
Copy link
Contributor

@awcodes awcodes commented Nov 5, 2022

This PR defaults the form model in actions to use the action's model before falling back to introspection to determine the model. This helps to mitigate problems where the introspection can result in the action form model being null.

@what-the-diff
Copy link
Contributor

what-the-diff bot commented Nov 5, 2022

  • The model for the mounted action form is now set to either the
    getModel() method of $action or, if that returns null, it will fall back
    on using whatever was returned by getMountedActionFormModel(). This allows
    actions which do not have a model (e.g., Delete) to still be able to use this
    component without having an error thrown when trying to access their nonexistent models.

@awcodes awcodes added the enhancement New feature or request label Nov 5, 2022
@danharrin danharrin merged commit 753d1e4 into 2.x Nov 5, 2022
@danharrin
Copy link
Member

Thanks

@danharrin danharrin deleted the enhance/mounted-action-form branch November 5, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants