From 5fe30cfc93c6079e8c0649729014d19675b1b935 Mon Sep 17 00:00:00 2001 From: sunnavy Date: Thu, 16 Nov 2023 12:19:09 -0500 Subject: [PATCH] Skip search menu process for ticket graph searches Unlike other saved searches, ticket graph searches do not live under /Search/ and do not have any menus either. --- lib/RT/Interface/Web.pm | 4 ++++ lib/RT/Interface/Web/MenuBuilder.pm | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm index 7718e619183..73a51b38d23 100644 --- a/lib/RT/Interface/Web.pm +++ b/lib/RT/Interface/Web.pm @@ -2051,6 +2051,10 @@ sub ExpandShortenerCode { if ( $type eq 'Chart' ) { $content->{SavedChartSearchId} = $id; } + elsif ( $type eq 'Graph' ) { + $content->{SavedSearchId} = $id; + $content->{SearchType} = 'Graph'; + } else { $content->{SavedSearchId} = $id; $content->{Class} = "RT::${type}s"; diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm index 19d0e689208..57c7240d57d 100644 --- a/lib/RT/Interface/Web/MenuBuilder.pm +++ b/lib/RT/Interface/Web/MenuBuilder.pm @@ -575,6 +575,7 @@ sub BuildMainNav { ( $request_path =~ m{^/(?:Ticket|Transaction|Search)/} && $request_path !~ m{^/Search/Simple\.html} + && ($HTML::Mason::Commands::DECODED_ARGS->{SearchType} // '') ne 'Graph' ) || ( $request_path =~ m{^/Search/Simple\.html} && $HTML::Mason::Commands::DECODED_ARGS->{'q'} )