Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#33804 closed enhancement (fixed)

Improve error handling when creating a new site and the user couldn't be created

Reported by: ocean90 Owned by: jeremyfelt
Priority: normal Milestone: 4.4
Component: Networks and Sites Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses: multisite

Description

There was an error creating the user.

Source: trunk/src/wp-admin/network/site-new.php#L95

You'll see this message when creating a new site, the email doesn't exist but the domain exists as a username because it's used as a fallback.

I think we should add a username_exists() check before calling wpmu_create_user() here.

Attachments (6)

33804.diff (650 bytes ) - added by utkarshpatel 11 years ago.
Added check for username exist
33804_1.diff (663 bytes ) - added by dipesh.kakadiya 11 years ago.
username_exists check added
33804_2.diff (694 bytes ) - added by utkarshpatel 11 years ago.
move condition before generating pass
33804_3.diff (630 bytes ) - added by utkarshpatel 11 years ago.
33804_4.diff (656 bytes ) - added by dipesh.kakadiya 11 years ago.
username_exists check added & error message updated
33804.2.diff (653 bytes ) - added by jeremyfelt 11 years ago.

Download all attachments as: .zip

Change History (12)

@utkarshpatel
11 years ago

Added check for username exist

@dipesh.kakadiya
11 years ago

username_exists check added

#1 @dipesh.kakadiya
11 years ago

  • Keywords has-patch added; needs-patch removed

@utkarshpatel
11 years ago

move condition before generating pass

@dipesh.kakadiya
11 years ago

username_exists check added & error message updated

@jeremyfelt
11 years ago

#2 @jeremyfelt
11 years ago

  • Milestone Awaiting Review4.4

33804.2.diff uses the text "The domain or path entered conflicts with an existing username."

I'd be okay changing the error message now for clarity. It would be nice to decouple this experience in the future. If we're creating a site and assigning an admin user, we shouldn't have to care about creating a user at the same time.

Related #14215, #33631

#3 @dipesh.kakadiya
11 years ago

@jeremyfelt

Updated error message has more clarity than previous one.
Thanks for suggestion.

This ticket was mentioned in Slack in #core by sergey. View the logs.


11 years ago

#5 @SergeyBiryukov
11 years ago

  • Keywords commit added
  • Owner set to jeremyfelt
  • Status newassigned

#6 @jeremyfelt
11 years ago

  • Resolutionfixed
  • Status assignedclosed

In 34996:

MS: Show an error if a new site slug conflicts with an existing username.

Props utkarshpatel, dipesh.kakadiya.
Fixes #33804.

Note: See TracTickets for help on using tickets.