Problem/Motivation

The users_field_data table has a langcode field, which allows translating users. When this is the case, the check in user_requirements() adds a warning to the status report page about conflicting user names, while this is technically the same user.

Steps to reproduce

  1. Translate a user account in multiple language
  2. Observe the warning on the status report page

Proposed resolution

When checking for conflicting user mails, we should probably take the langcode and UID into account as well.

CommentFileSizeAuthor
#10 3490639-nr-bot.txt91 bytesneeds-review-queue-bot

Issue fork drupal-3490639

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

seanb created an issue. See original summary.

pcambra made their first commit to this issue’s fork.

pcambra’s picture

Status: Active » Reviewed & tested by the community

I just found this issue myself, I think it doesn't really matter to group by uid, but we definitely need to group by language.

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

I think we could add some additional coverage to UserRequirementsTest for this - might just be a case of adding some more data.

dcam made their first commit to this issue’s fork.

dcam’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

I added a test.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Test coverage added

1) Drupal\Tests\user\Kernel\UserRequirementsTest::testTranslatedUserEmail
Failed asserting that an array does not have the key 'conflicting emails'.
/builds/issue/drupal-3490639/core/modules/user/tests/src/Kernel/UserRequirementsTest.php:80
FAILURES!
Tests: 3, Assertions: 20, Failures: 1.

Fix itself seems pretty simple enough

LGTM

w01f’s picture

Confirmed changes in fork branch to the two core user files resolves the issue on a new Drupal 11.6 install with multiple languages.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

dcam’s picture

Status: Needs work » Reviewed & tested by the community

Rebased, restoring RTBC

eduardo morales alberti’s picture

Hi!
Any news on this issue?
We had the same problem on our Drupal with duplicated users

  • larowlan committed df7e4792 on 11.2.x
    Issue #3490639 by dcam, seanb: Checking for duplicate emails in...

  • larowlan committed 95d3d95f on 11.x
    Issue #3490639 by dcam, seanb: Checking for duplicate emails in...
larowlan’s picture

Version: 11.x-dev » 11.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 11.x and backported to 11.2.x - thanks folks

pcambra’s picture

Thanks @larowlan, could we backport this to 10.x too?

pcambra’s picture

larowlan’s picture

Hi @pcambra - I don't think it qualifies for allowed changes for a maintenance minor release - but thanks for asking. If you feel otherwise, please comment with reasons and/or reach out on slack and we can discuss with release managers.

larowlan’s picture

Fixing credits

Status: Fixed » Closed (fixed)

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