Skip to content

Check cases only for new users, not updates. New tests. - #4749

Open
adamsilverstein wants to merge 6 commits into
WordPress:trunkfrom
adamsilverstein:ticket/57394-c
Open

adamsilverstein wants to merge 6 commits into
WordPress:trunkfrom
adamsilverstein:ticket/57394-c

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Jun 29, 2023 •

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/57394

Testing Instructions

Test in WordPress Playground


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

The check reverted in r55584 ran on every save, so updating a user whose
username matches their own email, or who already collided with another
user, failed. Usernames can only be set on insert, and emails are now
compared against existing usernames only when they are new or changing,
excluding the user being saved. Existing collisions are left alone, so
no previously valid update starts failing.

The same email-vs-username check is mirrored in register_new_user(),
edit_user(), the REST users update endpoint and the profile email change
confirmation, so users see a form error instead of a generic failure.
Imports skip the checks, matching the existing email uniqueness check.

Claude-Session: https://claude.ai/code/session_01XXGeBhJbUuzyPyZhFKKM5T
Data providers spell out which saves must be blocked and which must keep
working, including the cases behind the r55584 revert: a user whose
username is their own email, and users whose existing data already
collides with another account. Collisions are seeded directly in the
database to mirror sites that predate the check.

Replaces the earlier single test, which covered only one update case.

Claude-Session: https://claude.ai/code/session_01XXGeBhJbUuzyPyZhFKKM5T
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adamsilverstein.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant