Skip to content

Commit

Permalink
Merge pull request #16924 from opf/fix/57663-undefined-method-in-work…
Browse files Browse the repository at this point in the history
…-packages-menu-controler

handle missing referer
  • Loading branch information
ulferts authored Oct 9, 2024
2 parents 465e705 + 12ae58e commit 9250521
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/menus/work_packages/menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ def query_path(query_params)

def selected?(query_params)
return true if check_for_redirected_urls(query_params)

if query_params[:work_package_default] &&
(%i[filters query_props query_id name].none? { |k| params.key? k }) &&
@request.referer.include?("work_packages")
return true
end
return true if highlight_on_work_packages?(query_params)

super
end

def highlight_on_work_packages?(query_params)
query_params[:work_package_default] &&
(%i[filters query_props query_id name].none? { |k| params.key? k }) &&
String(@request.referer).include?("work_packages")
end

def ee_upsale_path(query_params)
share_upsale_work_packages_path({ name: query_params[:name] })
end
Expand Down

0 comments on commit 9250521

Please sign in to comment.