Register Form throws TypeError error if email or name fails constraint check

Created on 10 March 2023, over 1 year ago
Updated 19 January 2024, 5 months ago

Problem/Motivation

The eep module assumes that all violation in the 'mail' or 'user' field are caused by UniqueFieldConstraint. This is not the case. 'mail' and 'name' fields can throw a violation for other reasons. e.g. malformed email address. When this happens eep clears these violations and attempts to submit the form. The submit handler in ContentEntityForm attempts to reference the entity which does not exist to add last updated time which throws a TypeError

Steps to reproduce

I am using eep with simple_multistage but this may happen on all instances

    \
  1. Enable eep on register page
  2. Enable account creation by anonymous users
  3. Click Create Account on login page
  4. Fill out the form and add test@test as the email address
  5. Submit the form

Proposed resolution

EEP really only needs to filter out UniqueFieldContraint items from the violations list. If a remove uniqueFieldContstraints we know that a user exists for this piece of content so we will not get any errors on submit. If the violations are caused for any other reason leaving the violations in place stops the form from being submitted and the user gets a helpful error message.

πŸ› Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024