[Rt-commit] rt branch 5.0/modify-query-builder-default-results created. rt-5.0.3-123-g4d5065a8d9
BPS Git Server
git at git.bestpractical.com
Tue Sep 27 13:00:36 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/modify-query-builder-default-results has been created
at 4d5065a8d9425cb3156a6ed24d653eb7e087bc53 (commit)
- Log -----------------------------------------------------------------
commit 4d5065a8d9425cb3156a6ed24d653eb7e087bc53
Author: Jason Crome <jcrome at bestpractical.com>
Date: Mon Sep 26 13:30:44 2022 -0400
Make # of search results per-page configurable
On larger databases with many tickets and lots of custom roles,
displaying a page of 50 search results may become slow. Adjusting the
number of rows of search results per page can result in better
performance in these cases.
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index bd9c001d28..ca1acad0c6 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2260,6 +2260,14 @@ Set ($DefaultSearchResultFormat, qq{
'<small>__LastUpdatedRelative__</small>',
'<small>__TimeLeft__</small>'});
+=item C<$DefaultSearchResultRowsPerPage>
+
+C<$DefaultSearchResultRowsPerPage> is the default rows per page for RT
+search results
+
+=cut
+
+Set( $DefaultSearchResultRowsPerPage, 50 );
=item C<$UserTicketDataResultFormat>
diff --git a/share/html/Search/Build.html b/share/html/Search/Build.html
index 2f3be5f914..6a7f7e23d7 100644
--- a/share/html/Search/Build.html
+++ b/share/html/Search/Build.html
@@ -203,7 +203,7 @@ if ( $NewQuery ) {
OrderBy => $orderby{$Class},
Order => $order{$Class},
ObjectType => $ObjectType,
- RowsPerPage => 50
+ RowsPerPage => RT->Config->Get('DefaultSearchResultRowsPerPage') || 50
};
for( qw(Query Format OrderBy Order RowsPerPage ObjectType) ) {
diff --git a/share/html/Search/Edit.html b/share/html/Search/Edit.html
index a46bfb737e..054fe7416a 100644
--- a/share/html/Search/Edit.html
+++ b/share/html/Search/Edit.html
@@ -109,7 +109,7 @@ $SavedSearchId => 'new'
$SavedChartSearchId => 'new'
$Query => ''
$Format => ''
-$Rows => '50'
+$Rows => RT->Config->Get('DefaultSearchResultRowsPerPage') || '50'
$Order => 'ASC'
$Class => 'RT::Tickets'
$OrderBy => $Class eq 'RT::Assets' ? 'Name' : 'id'
diff --git a/share/html/Search/Elements/EditSearches b/share/html/Search/Elements/EditSearches
index 6871e702bb..d676a6cbc5 100644
--- a/share/html/Search/Elements/EditSearches
+++ b/share/html/Search/Elements/EditSearches
@@ -431,8 +431,9 @@ return @results;
<%METHOD GetDependedOnByList>
+% my $rows_per_page = RT->Config->Get('DefaultSearchResultRowsPerPage') || 50;
% my $links = $Object->DependedOnBy;
-% $links->RowsPerPage(50);
+% $links->RowsPerPage( $rows_per_page );
% my $total = $links->CountAll;
<p>
<&|/l, $total &>This search is used in the following [quant,_1,dashboard,dashboards]</&>:
@@ -448,7 +449,7 @@ return @results;
</li>
% }
-% if ( $total > 50 ) {
+% if ( $total > $rows_per_page ) {
<li class="list-group-item">...</li>
% }
</ul>
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list