Problem/Motivation
When rendering a custom form for an existing user without the username or email fields it still alters the form and effectively adds the name in but with just type=>value and it then tries to save a null against the user and crashes.
Steps to reproduce
Create new view mode for user entity
Only add as an example, a custom field on it, such as address
Create custom form route to display user with that new form view mode
Attempt to save the form
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null
Proposed resolution
Only adjust form elements that exist in the entity form
Remaining tasks
-
User interface changes
-
API changes
-
Data model changes
-
Issue fork email_registration-3318717
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
driskell commentedComment #4
anybodyFailing tests are unrelated, also fail in dev.
Comment #5
anybody@Grevil: To me this change looks absolutely reasonable as a safety net. Can you see any possible side-effects? Otherwise I'd vote to merge this in?
RTBC+1 from my side. I see that case.
Comment #7
grevil commentedYea LGTM! RTBC!
Comment #8
grevil commentedMerged. Thanks @Driskell!
Comment #9
grevil commented