Problem/Motivation
I came across this issue when I tried changing the user role.
Steps to reproduce
I believe the website I am working with installed the advanced_email_validation module later at some stage. The email field for user is non required and doesn't have a value in it. When I try to change the role the site breaks and complains:
Call to a member function get() on null in Drupal\advanced_email_validation\Plugin\Validation\Constraint\AEVChangedEmailValidator->valueChanged() (line 72 of docroot/modules/contrib/advanced_email_validation/src/Plugin/Validation/Constraint/AEVChangedEmailValidator.php)
Proposed resolution
Handling the storedEntity object and not access it if the value is missing
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3540324-2.patch | 1021 bytes | saurabh-2k17 |
Issue fork advanced_email_validation-3540324
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 #2
saurabh-2k17 commentedComment #3
saurabh-2k17 commentedComment #4
saurabh-2k17 commentedComment #5
darvanenSorry I didn't see this when it came through, taking a look now.
Comment #7
darvanenPushed a(n accidentally) test-only MR and it fails as expected:
https://git.drupalcode.org/project/advanced_email_validation/-/jobs/6887330
Comment #8
darvanen@saurabh-2k17 it would be great if you could test the changes in the MR against your specific issue?
I think the tests are pretty comprehensive but I do really like to have confirmation against the original report where possible.
Comment #9
pakmanlhI can confirm the same situation with the users with no mandatory e-mail not being able to be updated works now.
Comment #11
darvanen