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

CommentFileSizeAuthor
#2 3540324-2.patch1021 bytessaurabh-2k17
Command icon 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

saurabh-2k17 created an issue. See original summary.

saurabh-2k17’s picture

StatusFileSize
new1021 bytes
saurabh-2k17’s picture

Status: Active » Needs review
saurabh-2k17’s picture

Assigned: saurabh-2k17 » Unassigned
darvanen’s picture

Assigned: Unassigned » darvanen

Sorry I didn't see this when it came through, taking a look now.

darvanen’s picture

Status: Needs review » Needs work

Pushed a(n accidentally) test-only MR and it fails as expected:

https://git.drupalcode.org/project/advanced_email_validation/-/jobs/6887330

darvanen’s picture

Version: 2.0.2 » 2.x-dev
Assigned: darvanen » Unassigned
Status: Needs work » Needs review

@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.

pakmanlh’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm the same situation with the users with no mandatory e-mail not being able to be updated works now.

  • darvanen committed f834b568 on 2.x
    fix: #3540324 Call to a member function get() on null
    
    By: saurabh-2k17...
darvanen’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • 0f7137f1 committed on 1.x
    Fix flaky test: use randomMachineName() for error-message assertions...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.