Global setting for reference code separator affects new user slug generation
|Target version:||Release 2.3.1|
|Google Code Legacy ID:||Tested version:||2.3, 2.4|
First reported in the AtoM User Forum here in 2.2; reproduced in qa/2.4.x
- Change the Reference code separator setting in Admin > Settings > Global from the default "-" dash to a period "."
- Create a new user, save
- when the random new user slug is generated, it will include a period instead of a dash
- Using a period in the URL is not valid in AtoM
- Depending on AtoM version, this means either:
- You get a 500 error, or
- You get a page not found message every time you try to view the user, making their user page inaccessible
- Default separator does not affect slug generation anywhere in the application
- New users can be created and their user profile page access regardless of the separator character used
It seems that the separator value is being checked in the slugify function - in fact, AtoM should always use dashes as the separator for slugs. The separator value should ONLY be checked when generating reference codes.
#2 Updated by David Juhasz almost 5 years ago
- Subject changed from Global setting for reference code separator affects new user slug generation to Global setting for reference code separator affects new user slug generation
- Priority changed from High to Critical
This is creating slugs that break the ability to edit events as well. Elevating to critical.
#7 Updated by Jesús García Crespo almost 5 years ago
- Status changed from Code Review to Feedback
- Assignee changed from Nick Wilkinson to Steve Breker
I'm not sure if we can include a new migration in 2.3.1, should we do that? Can we discuss on Monday and check with the rest of the team? The PR is fine as long as it's only merged into qa/2.4.x - we may have to find other ways to fix the data for 2.3 users, e.g. tools:run script?
#8 Updated by Steve Breker almost 5 years ago
- Status changed from Feedback to QA/Review
- Assignee changed from Steve Breker to Dan Gillean
At Jesús and David's suggestion, I have dropped the migration program. Correcting existing separators in the database will be accomplished with a tools:run CLI script.
#11 Updated by Dan Gillean almost 5 years ago
- Status changed from QA/Review to Verified
- Assignee changed from Dan Gillean to Steve Breker
Tested in 2.4 that I could change the separator to a period, and still create new users (dashes are used; separator is ignored) and edit events. Tested in 2.3 that I could break a user based on this issue's description, and then run the attached php script and resolve the issue.
Steve, I think this can be merged to 2.3.1 now.
#12 Updated by Steve Breker almost 5 years ago
- Status changed from Verified to Deploy
- Assignee changed from Steve Breker to Nick Wilkinson
Cherry pick to stable/2.3.x complete. Ready for deployment to client site.
See attached script to be run on sites (using tools:run) experiencing this issue. Script will correct data in slug table to use the correct separator.
#15 Updated by Dan Gillean almost 5 years ago
I've added the script to a public gist, here - will add some basic instructions to the wiki.
#16 Updated by Dan Gillean almost 5 years ago
- Status changed from Document to Verified
- Assignee deleted (
Instructions added to 2.3 docs in the settings page for the reference code separator - see: https://github.com/artefactual/atom-docs/commit/3d2bd4cc0b262d6316f7794c21163ac9e1c0442f
Also created a placeholder 2.3.1 release wiki page and added the instructions there: https://wiki.accesstomemory.org/Releases/Release_announcements/Release_2.3.1
Finally, updated the 2.3 release page with a "known issues" section that also includes the fix instructions. https://wiki.accesstomemory.org/Releases/Release_announcements/Release_2.3#Known_Issues