FIX: Preserve preview_theme_id param on topic redirects (#23965)

Why this change?

When the URL `/t/1234?preview_theme_id=21` is loaded, we redirect to
`/t/<topic slug>/1234` stripping the `preview_theme_id` query params.

What does this change do?

This change builds on 61248652cd and
simply adds the `preview_theme_id` query param when redirecting.
This commit is contained in:
Alan Guo Xiang Tan
2023-10-19 09:32:56 +08:00
committed by GitHub
parent 788651467b
commit b4eb078b0e
2 changed files with 10 additions and 5 deletions

View File

@@ -1253,7 +1253,7 @@ class TopicsController < ApplicationController
raise(SiteSetting.detailed_404 ? ex : Discourse::NotFound)
end
opts = params.slice(:page, :print, :filter_top_level_replies)
opts = params.slice(:page, :print, :filter_top_level_replies, :preview_theme_id)
opts.delete(:page) if params[:page] == 0
url = topic.relative_url