Redirects on load remove URL parameters

AI-generated summary

Redirects on load remove URL parameters: A discussion about an issue where URL parameters, such as preview_theme_id and safe_mode, are stripped off when a shortened link redirects to the full topic URL. Firepup650 first reported the issue, which may be a feature request rather than a bug, as query parameters were not intended to be included with short links awesomerobot. The issue is also seen when a topic’s title changes Firepup650. A fix for this issue has been implemented in https://github.com/discourse/discourse/pull/23965 tgxworld, but it is unclear if it also applies to safe_mode parameters Firepup650.

Noticed this a while ago, just remembered it.

Sometimes, I publicly post links on our forum to a theme preview link so others can see new changes before they’re applied to all themes. I’ll give out a link like: https://amcforum.wiki/t/author-badges-theme-component-side-wide/2262?preview_theme_id=56
Which is long, so I’ll try to shorten it to: https://amcforum.wiki/t/2262?preview_theme_id=56
But that doesn’t work, because when it redirects to the full topic URL it strips off the preview theme.

The same thing occurs with safe mode query params.

5 Likes

Someone with a better understanding of our routing will hopefully chime in… but this might be more of a feature request than a bug.

I’m not sure query parameters were ever intended to be included with those short links — my understanding is that when a short link is used the application checks for the permalink, and redirects to that… so the query param would need to be lifted off the short link and reapplied to the permalink to get this working.

3 Likes

Interesting, I didn’t know it worked that way.

(Likely due to that same functionality) if a topic’s title changes, the same issue/behavior occurs.

1 Like

This has been fixed in

https://github.com/discourse/discourse/pull/23965

2 Likes

Does that fix also apply to safe_mode params?

1 Like

This topic was automatically closed after 11 days. New replies are no longer allowed.