Skip to content

Commit

Permalink
Merge pull request #47 from sascha-karnatz/fix-preview-query
Browse files Browse the repository at this point in the history
Fix preview if search_result_page is nil
  • Loading branch information
tvdeyen authored Oct 3, 2024
2 parents f544f7c + f128eae commit 88a9904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controller/alchemy/pg_search/controller_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def paginate_per

def set_preview_query
if self.class == Alchemy::Admin::PagesController && params[:query].blank?
element = search_result_page.draft_version.elements.named(:searchresults).first
element = search_result_page&.draft_version&.elements&.named(:searchresults)&.first

params[:query] = element&.value_for("search_string") || "lorem"
end
Expand Down

0 comments on commit 88a9904

Please sign in to comment.