[6.x] Fix user wizard breaking when blueprint has conditional fields - #15324
Merged
Conversation
…the page expects Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCUSBPwNcugkYRdjiWBJC
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCUSBPwNcugkYRdjiWBJC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes an issue where adding a field condition to the user blueprint could break the "create user" wizard — clicking Next wouldn't advance, and Vue would log "Unhandled error during execution of component update" and "Cannot destructure property 'type' of 'vnode' as it is null" errors.
This was happening because the create controller passes the pre-processed values under a
valueskey, while theusers/Createpage expects aninitialValuesprop. The wizard's publish container ended up running on an empty object, so every field's value resolved tonullinstead of its pre-processed default. Fieldtypes that expect an array value (likeuser_rolesorentries) then throw while computing their field actions, leaving a half-rendered component that crashes Vue when the step is unmounted — freezing the wizard.This PR fixes it by passing the values under the
initialValueskey the page expects, so field defaults reach the wizard and field conditions evaluate against real values.This PR also provides the wizard's
roles,groupsandsuperselections as extra values to the publish container, so conditions referencing them behave the same as on the Edit User page (e.g. a field with "show whenrolescontainseditor" will appear on the first step after assigning the role and navigating back).Fixes #15316
Caused by #12942