ryantm reported that left clicking on a permalink does not work. To reproduce the issue:
Create a post with a link to a category (e.g., /c/lounge).
Rename the category (e.g., to lounge2).
Left click on the original link.
This results in a 403 Forbidden error. ryantm provided console logs and screenshots.
codinghorror questioned whether old links should still work after renaming a category. ryantm clarified that the issue is not specific to renaming categories, but rather with how permalinks work in general.
ryantm further tested and found that the bug affects all permalinks, not just those in the same namespace as categories. They also mentioned a related PR that would fix the issue by causing a server-side refresh on an unknown route.
The title of this thread was edited to be more specific than the issue, which affects all permalinks, not just those related to category renaming. A potential fix mentioned by Benjol was ruled out by ryantm as only related to categories in subfolder installs, not permalinks in general.
ember:5732 DEBUG: -------------------------------
ember:5732 DEBUG: Ember : 2.10.0
ember:5732 DEBUG: jQuery : 2.2.0
ember:5732 DEBUG: -------------------------------
ember:5732 DEBUG: For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi
http://192.168.0.86:4000/c/lounge/find_by_slug.json?_=1484680046186 Failed to load resource: the server responded with a status of 403 (Forbidden)
discourse/routes/application:86 Object
error @ discourse/routes/application:86
ember:27784 Error while processing route: discovery.parentCategory
logError @ ember:27784
ember:16911 Error: Forbidden
at unwrapErrorThrown (ember:30421:15)
at errorFor (ember:30403:14)
at onerrorDefault (ember:30393:17)
at Object.trigger (ember:57841:9)
at eval (ember:58725:26)
at invoke (ember:339:14)
at Queue.flush (ember:407:9)
at DeferredActionQueues.flush (ember:531:15)
at Backburner.end (ember:601:23)
at Backburner.run (ember:724:16)
defaultDispatch @ ember:16911
lounge2:192 Uncaught promise: Object
Refreshing the page, or middle clicking the link works.
Because Discourse automatically makes a “Permalink”, a URL redirect, when you rename a category. The point of this bug isn’t about renaming categories. All Permalinks do not work in the same way.
I did some more testing. The bug is worse for permalinks that inhabit the same namespace as categories (e.g. “c/lounge”). If you make a permalink that doesn’t inhabit any special namespace (e.g. one with the URL “permalink1”), you get the standard broken “Oops! That page doesn’t exist or is private.” when you left click on it in a forum post. cc @eviltrout
By the way, the non-special route permalinks being broken is another example of a bug that would be fixed by my PR that causes a server-side refresh on an unknown route:
@codinghorror Unless something changed recently, your edit of the title of this thread is not accurate. This issue affects all permalinks. Left clicking any permalink doesn’t work. The category renaming was just an example.
That bugfix looks only related to categories in subfolder installs not permalink fixing. As I mentioned above the title of this topic was incorrectly changed to be more specific than it is. This problem effects all permalinks.