[Rt-commit] rt branch, 4.2/user-autocomplete-cfs, updated. rt-4.1.8-417-gf139758

Alex Vandiver alexmv at bestpractical.com
Tue May 28 15:12:40 EDT 2013


The branch, 4.2/user-autocomplete-cfs has been updated
       via  f139758d478c55490fb40d266a197432f6e51ca2 (commit)
      from  a84bc821a6abf0225777495c8a16d8ef78766e96 (commit)

Summary of changes:
 share/html/User/Search.html | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit f139758d478c55490fb40d266a197432f6e51ca2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue May 28 15:12:37 2013 -0400

    Use ->First instead of ->Count to avoidrunning the query twice

diff --git a/share/html/User/Search.html b/share/html/User/Search.html
index 102a93d..823bfa7 100644
--- a/share/html/User/Search.html
+++ b/share/html/User/Search.html
@@ -92,8 +92,11 @@ $users->SimpleSearch( Return    => 'Name',
                       Max       => 100,
                       Exclude   => $exclude );
 
-RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."User/Summary.html?id=".$users->First->Id)
-    if $users->Count == 1;
+my $first = $users->First;
+RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."User/Summary.html?id=".$first->Id)
+    if $first;
+
+$users->GotoFirstItem;
 
 my $Format = RT->Config->Get('UserSearchResultFormat');
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list