New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop manually slugifying PLC course names #30779
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
islemaster
requested review from
breville,
clareconstantine,
hacodeorg and
maddiedierker
September 13, 2019 23:53
breville
approved these changes
Sep 14, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
maddiedierker
approved these changes
Sep 14, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clareconstantine
approved these changes
Sep 16, 2019
islemaster
force-pushed
the
plc-course-names
branch
from
September 17, 2019 17:35
346ba0c
to
04aefc4
Compare
7 tasks
islemaster
added a commit
that referenced
this pull request
Jun 17, 2020
This change removes some unneeded CoursesController logic. Prior to September 2019, we had a system in place that would "slug-ify" PLC course names in generated links. For example: A course named `Professional Learning` would be slugified to `professional-learning` for urls. We also had code in CoursesController to "un-slug-ify" these course names so the appropriate course could be loaded. Unfortunately, our course names got more complicated and this system wasn't able to handle them well. Here's a known broken case: ``` // The real course name "CS Discoveries Deeper Learning 2019 - 2020" // Slug-ified "cs-discoveries-deeper-learning-2019---2020" // Unsuccessfully restored "Cs Discoveries Deeper Learning 2019 2020" ``` Nine months ago we [removed this slugification logic](#30779); now we simply urlencode course names. At the time, we left the unslug logic in with a Honeybadger notification, to avoid breaking existing links and to monitor how much use this system was seeing. In the last nine months we have seen slugified PLC course links used a total of 89 times, and only for the `CSP Support` course. Nobody among developers or PLC partners has been able to track down where such a link still exists in our system. Andrea shared that this is an old course, and that link should not be used by anyone except a former participant trying to review their answers. I propose that it's time to deprecate this logic, which unnecessarily complicates our course routing. If anyone contacts us about the `csp-support` link, we can handle this manually and share an updated link with them.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PLC-452: Some of our PLC course links (including breadcrumbs) are broken (Slack) because we've been manually slug-ifying the PLC course names for our URLs with:
...and trying to restore them with...
This worked fine for the one simple test case we had in place (
My Plc <=> my_plc
) but our real course names don't look like that. A recent broken example:This PR removes the "slugification" code and replaces it with a more typical use of the
course_path
helper, passing it aCourse
model and letting it perform all the appropriate URL encoding so that the links work fine when they're used later.I've left the following "un-slug" code in place for now, in case there are any links or bookmarks out there still depending on the old behavior:
code-dot-org/dashboard/app/controllers/courses_controller.rb
Lines 49 to 57 in 1838c6e
We'll watch for remaining uses of this path and remove it when we're confident it's no longer needed.