[Rt-commit] rt branch, 4.0/saved-search-context, updated. rt-4.0.1-214-g277a702
Jason May
jasonmay at bestpractical.com
Thu Aug 11 17:00:16 EDT 2011
The branch, 4.0/saved-search-context has been updated
via 277a702b1634d44bde34c5823d26e03916b0fcc2 (commit)
from 88e329a4aab573f221a85ca60f4684626442bfea (commit)
Summary of changes:
share/html/Elements/Tabs | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit 277a702b1634d44bde34c5823d26e03916b0fcc2
Author: Jason May <jasonmay at bestpractical.com>
Date: Thu Aug 11 16:58:22 2011 -0400
Just use values in the fallback query hash, not subrefs to them
I thought it would reduce unnecessary computations, but it just makes
the code more complicated.
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index e2588f7..5863f65 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -576,19 +576,19 @@ my $build_admin_menu = sub {
my %query_args;
my %fallback_query_args = (
- SavedSearchId => sub { ( $search_id eq 'new' ) ? undef : $search_id },
- SavedChartSearchId => sub { $chart_id },
+ SavedSearchId => ( $search_id eq 'new' ) ? undef : $search_id,
+ SavedChartSearchId => $chart_id,
(
map {
my $p = $_;
- $p => sub { $m->request_args->{$p} || $current_search->{$p} }
+ $p => $m->request_args->{$p} || $current_search->{$p}
} qw(Query Format OrderBy Order Page)
),
- RowsPerPage => sub {
+ RowsPerPage => (
defined $m->request_args->{'RowsPerPage'}
? $m->request_args->{'RowsPerPage'}
: $current_search->{'RowsPerPage'}
- },
+ ),
);
if ($QueryString) {
@@ -601,7 +601,7 @@ my $build_admin_menu = sub {
for my $param (keys %fallback_query_args) {
$final_query_args{$param} = defined($QueryArgs->{$param})
? $QueryArgs->{$param}
- : $fallback_query_args{$param}->();
+ : $fallback_query_args{$param};
}
for my $field (qw(Order OrderBy)) {
@@ -645,7 +645,7 @@ my $build_admin_menu = sub {
path => "/Search/Results.tsv$args" );
my %rss_data = map {
- $_ => $QueryArgs->{$_} || $fallback_query_args{$_}->() || '' }
+ $_ => $QueryArgs->{$_} || $fallback_query_args{$_} || '' }
qw(Query Order OrderBy);
my $RSSQueryString = "?"
. $query_string->( Query => $rss_data{Query},
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list