app/controllers/alchemy/admin/pages_controller.rb in alchemy_cms-7.1.0.pre.b1 vs app/controllers/alchemy/admin/pages_controller.rb in alchemy_cms-7.1.0.pre.b2

- old
+ new

@@ -181,14 +181,19 @@ flash[:notice] = Alchemy.t(:unlocked_page, name: @page.name) @pages_locked_by_user = Page.from_current_site.locked_by(current_alchemy_user) respond_to do |format| format.js format.html do - redirect_to( - params[:redirect_to].presence || admin_pages_path, - allow_other_host: true - ) + redirect_to(unlock_redirect_path, allow_other_host: true) end + end + end + + def unlock_redirect_path + if params[:redirect_to].to_s.match?(/\A\/admin\/(layout_)?pages/) + params[:redirect_to] + else + admin_pages_path end end # Sets the page public and updates the published_at attribute that is used as cache_key #