april-knights / Squire

Core files for the Squire 2 web application.
GNU General Public License v3.0
2 stars 0 forks source link

Existing "email has already been taken" #60

Open LadyVulcan opened 2 years ago

LadyVulcan commented 2 years ago

Describe the bug Editing a Knight sometimes produces an error "The email has already been taken." and wipes edit progress

To Reproduce Steps to reproduce the behavior:

  1. Go to (https://squire.aprilknights.org/profile/Startttttt/edit)
  2. Their existing email address field had been "none@aprilknight.org"
  3. Added text to "About Me" field
  4. Clicked submit
  5. Received error and edited text was gone.

Expected behavior An existing field shouldn't throw errors, so perhaps data validation needs to be done on the existing data. Furthermore, can we cache the data entered at the time of submit and give that back to the user?

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Gryph667 commented 2 years ago

I noticed this last night. This is resulting from users that were imported via script, when no email was known. Email in the business layer is unique. I would assert that the core issue in this interaction is the retention of other edits made. Will require an assessment of at minimum /squire2/squire/resources/views/profile/edit.blade.php and probably /squire2/squire/resources/views/profile/new.blade.php