Order by jitemid properly as a fallback, when we are ordering by 
logtime and logtime is the same. (for communities and feeds)

        Patch by kareila. 

diffs (28 lines):

diff -r a8a7e3b90b3a -r 274654be3959 cgi-bin/DW/Logic/LogItems.pm
--- a/cgi-bin/DW/Logic/LogItems.pm      Fri Feb 04 00:59:00 2011 +0800
+++ b/cgi-bin/DW/Logic/LogItems.pm      Fri Feb 04 11:34:24 2011 +0800
@@ -554,7 +554,7 @@ sub recent_items
                allowmask, eventtime, logtime
         FROM log2 USE INDEX ($sort_key)
         WHERE journalid=$userid $sql_select $secwhere $jitemidwhere 
$securitywhere $posterwhere
-        ORDER BY journalid, $sort_key, jitemid DESC
+        ORDER BY journalid, $sort_key
         $sql_limit
     };
 
@@ -579,10 +579,13 @@ sub recent_items
     while (my $li = $sth->fetchrow_hashref) {
         push @{$args{'itemids'}}, $li->{'itemid'};
 
+        my $sortdate = { rlogtime => 'system_alldatepart',
+                         revttime => 'alldatepart' }->{$sort_key};
+
         $flush->() unless defined $last_time &&
-                          $li->{alldatepart} eq $last_time;
+                          $li->{$sortdate} eq $last_time;
         push @buf, $li;
-        $last_time = $li->{alldatepart};
+        $last_time = $li->{$sortdate};
 
         # construct an LJ::Entry singleton
         my $entry = LJ::Entry->new($userid, jitemid => $li->{itemid});
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to