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

[4.x] Fix blueprint error when creating user #9276

Merged

Conversation

duncanmcclean
Copy link
Member

This pull request fixes an issue where you'd see an error when attempting to create a user in the Control Panel without there being a user blueprint saved (eg. no resources/blueprints/user.yaml file).

It doesn't look like the ensureFieldHasConfig method works when the email field is added to the blueprint via ensureField.

$blueprint->ensureFieldHasConfig('email', ['validate' => 'required']);

To workaround this, I've made it so the User blueprint always has an email field so it'll exist for ensureFieldHasConfig being called in the controller.

I don't know lots about how the field ensuring stuff works so let me know if there's a better way to fix this.

Fixes #9274.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit redundant, but it seems to fix it. It'll do until we can rework all the ensureField stuff.

@jasonvarga jasonvarga merged commit 2802f1b into 4.x Mar 19, 2024
35 checks passed
@jasonvarga jasonvarga deleted the fix/user-blueprint-error-when-attempting-to-create-user branch March 19, 2024 14:50
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.

[Create a user] - Undefined array key "email"
2 participants