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

fix for conditional fields in globals, users not being saved #12323

Closed

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Nov 16, 2022

Description

Conditional fields in globals aren't saved. This is in fact happening "because Element::setFieldValuesFromRequest() is running Element::fieldLayoutFields($visibleOnly = true)".

It doesn't happen for entries because of autosaving drafts being turned on. When your draft is autosaved, it only gets validated against the "essentials" and all values are saved to the DB and then by the time you see the conditioned field, it's already treated as visible. If you were to disable autosaving drafts, you would see the exact same behaviour for entries too (but we do not encourage disabling autosaving drafts).

This issue is happening for Globals, Users and Assets because these elements do not have autosaving functionality.

This change is to check if element on which we're trying to setFieldValuesFromRequest() supports autosaving.

Related issues

#12166

@i-just i-just requested a review from a team as a code owner November 16, 2022 15:33
@brandonkelly brandonkelly deleted the bugfix/12166-conditional-fields-not-being-saved branch November 16, 2022 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants