[Rt-commit] rt branch, 4.2/user-ticketlist, created. rt-4.2.0-28-g3945cbe

Alex Vandiver alexmv at bestpractical.com
Thu Oct 31 14:00:42 EDT 2013


The branch, 4.2/user-ticketlist has been created
        at  3945cbe100786c87cd00f008ddb14ab4eed4e720 (commit)

- Log -----------------------------------------------------------------
commit ba741bf01fcca985d1d6543bc3bfcee2a165e357
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Oct 24 15:55:33 2013 -0400

    Move use of QueryProperties until after the callback can modify them
    
    Otherwise, the constructed link will not contain any changes that the
    callback made to the sort order or query.

diff --git a/share/html/User/Elements/TicketList b/share/html/User/Elements/TicketList
index 9f90c88..2eb250f 100644
--- a/share/html/User/Elements/TicketList
+++ b/share/html/User/Elements/TicketList
@@ -88,6 +88,11 @@ my %QueryProperties = (
     Format     => $Format,
 );
 
+$m->callback( CallbackName => 'ModifyQueryProperties',
+    %ARGS,
+    QueryProperties => \%QueryProperties,
+);
+
 my $url  = RT->Config->Get('WebPath') . '/Search/Results.html?';
    $url .= $m->comp('/Elements/QueryString',
                     Query       => $QueryProperties{'Query'},
@@ -95,11 +100,6 @@ my $url  = RT->Config->Get('WebPath') . '/Search/Results.html?';
                     Order       => $QueryProperties{'Order'},
            );
 
-$m->callback( CallbackName => 'ModifyQueryProperties',
-    %ARGS,
-    QueryProperties => \%QueryProperties,
-);
-
 </%INIT>
 <%ARGS>
 $Title => ''

commit 3945cbe100786c87cd00f008ddb14ab4eed4e720
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Oct 25 13:20:48 2013 -0400

    Secondarily order by id descending, as Priority is often unset
    
    As Priority defaults to all being the same value, it falls to the
    database as to how to sort the remaining tickets.  At best, such as on
    MySQL, this is ascending by id (which is fairly useless) -- and at worst
    it is pseudo-random (on PostgreSQL).
    
    Add a secondary sort by id, descending, which will tend to show more
    recent tickets in the limited set of rows.

diff --git a/share/html/User/Elements/TicketList b/share/html/User/Elements/TicketList
index 2eb250f..b37f024 100644
--- a/share/html/User/Elements/TicketList
+++ b/share/html/User/Elements/TicketList
@@ -81,8 +81,8 @@ if (@$conditions) {
 
 my %QueryProperties = (
     Query      => $sql,
-    OrderBy    => 'Priority',
-    Order      => 'DESC',
+    OrderBy    => 'Priority|id',
+    Order      => 'DESC|DESC',
     Rows       => $Rows || 10,
     ShowHeader => $ShowHeader,
     Format     => $Format,

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


More information about the Rt-commit mailing list