[Rt-commit] rt branch, 4.4/config-option-search-results-navigation-links, repushed
Craig Kaiser
craig at bestpractical.com
Fri Aug 28 13:01:07 EDT 2020
The branch 4.4/config-option-search-results-navigation-links was deleted and repushed:
was 3885a01c0a3b7a856fd470064373cc7d589061c8
now e9c85eb96ace4d23ed59880e726fbe4533fe1f77
1: 998c738407 ! 1: 15ee84ebb3 Add config option to disable search results navigation links
@@ -14,7 +14,7 @@
Set($SearchResultsAutoRedirect, 0);
+
-+=item C<$SearchResultsNavigationLinks>
++=item C<$ShowSearchResultsNavInMenu>
+
+Option to build the search navigation options in the RT menu ( First, Last, Prev, Next ).
+This feature requires the re-running of the current search in order to accuratly create
@@ -22,7 +22,7 @@
+
+=cut
+
-+Set($SearchResultsNavigationLinks, 1);
++Set($ShowSearchResultsNavInMenu, 1);
+
=back
@@ -38,7 +38,7 @@
- if ( defined $session{"tickets"} ) {
- # we have to update session data if we get new ItemMap
- my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
-+ if ( RT::Config->Get( 'SearchResultsNavigationLinks' ) ) {
++ if ( RT::Config->Get( 'ShowSearchResultsNavInMenu' ) ) {
+ if ( defined $session{"tickets"} ) {
+ # we have to update session data if we get new ItemMap
+ my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
@@ -96,7 +96,7 @@
my %link_rel;
-if (defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'})) {
-+if (RT::Config->Get( 'SearchResultsNavigationLinks' ) && defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'})) {
++if (RT::Config->Get( 'ShowSearchResultsNavInMenu' ) && defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'})) {
my $item_map = $session{'tickets'}->ItemMap;
$link_rel{first} = "/Ticket/Display.html?id=" . $item_map->{first} if $item_map->{$TicketObj->Id}{prev};
$link_rel{prev} = "/Ticket/Display.html?id=" . $item_map->{$TicketObj->Id}{prev} if $item_map->{$TicketObj->Id}{prev};
2: 3885a01c0a ! 2: 9e0bd5b9f7 Add tests for 'ShowSearchResultsNavInMenu' config option
@@ -1,6 +1,6 @@
Author: craig kaiser <craig at bestpractical.com>
- Add tests for 'SearchResultsNavigationLinks' config option
+ Add tests for 'ShowSearchResultsNavInMenu' config option
diff --git a/t/web/search_linkdisplay.t b/t/web/search_linkdisplay.t
--- a/t/web/search_linkdisplay.t
@@ -17,10 +17,10 @@
+my $t_link = $m->find_link( id => "search-tickets-next" )->url;
+is ($t_link, "/Ticket/Display.html?id=".$ticket2->Id, 'link to the next ticket in current search found');
+
-+diag "Set SearchResultsNavigationLinks to false and confirm we do not load navigation links.";
++diag "Set ShowSearchResultsNavInMenu to false and confirm we do not load navigation links.";
+{
+ RT::Test->stop_server;
-+ RT->Config->Set( 'SearchResultsNavigationLinks' => 0 );
++ RT->Config->Set( 'ShowSearchResultsNavInMenu' => 0 );
+ ($baseurl, $m) = RT::Test->started_ok;
+
+ # Get a search that returns multiple tickets
@@ -31,3 +31,4 @@
+ is($t_link, undef, "Search navigation results are not rendered");
+}
done_testing;
+
-: ------- > 3: fb98ee7a53 Allow ShowSearchResultsNavInMenu to be user level overridable
-: ------- > 4: e9c85eb96a Add tests for setting user pref of 'ShowSearchResultsNavInMenu'
More information about the rt-commit
mailing list