Custom user entity forms crash when module is enabled if username or email is not on the form

Created on 2 November 2022, about 2 years ago
Updated 9 October 2023, about 1 year ago

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

-

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Driskell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024