Only allow URL safe characters (ASCII) for topic_explore_projects_path
Previous discussion in !122970 (comment 1422903154)
The topic_explore_projects_path_path(topic_name: ) accepts too much. We should restrict character set for Topic#name. Note we already have Topic#title for user facing string
To also solve for #479264 for unicode users, rather than a blanket "invalid characters" message we should separately identify that unicode characters are not possible and must be replaced by ASCII characters. Solved in !168899 (merged).
Implementation Guide
-
Release N: Add new slugcolumn. Add code that populatesslugfromnamefor new records -
Release N: Populate slugcolumn, using data fromnamecolumn with https://docs.gitlab.com/ee/development/database/batched_background_migrations.html. -
Release M onwards: Ensure that the slugcolumn has presence validation, and is non-nullable in the database. This includes:- Adding
presence: truevalidation toslug - Swapping out
namein the form withslug - Adding a DB migration to set the
slugcolumn to be non-nullable - Checking all other places where
nameis used, and replace that withsluginstead.
- Adding
-
Release M onwards: Now that the namecolumn is no longer used, follow the steps to drop thenamecolumn https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#dropping-columns. - Remove the
explore_topics_cleaned_pathFF, if not already done
Edited by Thong Kuah