The display from the admin/node page is not sorted by anything. This is confusing.

In order to make the display make sense, I recommend sorting it by the date of last change.

Here is a patch for doing this. Line 912 of node.module in 4.6:

$result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $join .' INNER JOIN {users} u ON n.uid = u.uid '. $where, 50, 0, NULL, $args);

Should be:

$result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $join .' INNER JOIN {users} u ON n.uid = u.uid '. $where . " ORDER BY n.changed DESC ", 50, 0, NULL, $args);

CommentFileSizeAuthor
#3 node.module-admin_node_not_sorted.patch.txt709 byteskbahey

Comments

Bèr Kessels’s picture

Kbahey, cuold you make this into a real patch? that way it fits within Drupals workflow. It is very hard for most people to edit modules based on some vague descriptions with some code.

A patch, on the other side can be made undone very easy, it can be saved, it just works much better. However, it may be that you did not know how to make a patch. in that case, you might want to look here: http://drupal.org/repos

zach harkey’s picture

This is very badly needed. I couldn't believe the list was in no particular order with no way to sort the whole list by date etc. This really blew the usefulness of this whole page imo. Thank you fo the patch.

kbahey’s picture

StatusFileSize
new709 bytes

Ber.

I know how to make a patch, but this seemed so trivial that it did not warrant one.

Anyway, here it is.

ec’s picture

kbahey, thanks for this enhancement, it's very nice and it was obviously missing. But your patch is in reverse order ;-). here is the right one. regards, eric.

ec’s picture

kbahey, thanks for this enhancement, it's very nice and it was obviously missing. But your patch is in reverse order ;-). here is the right one. regards, eric.

ec’s picture

sorry, drupal don't want my file, I try again for the last time. If I don't succeed, be carefull don't use the patch above, instead make the change by hand ! eric.

kbahey’s picture

Here is the correct patch. Thanks for pointing out that it is reversed.

kbahey’s picture

It seems that I can't upload a patch either.

kbahey’s picture

Attempt to upload correct patch

kbahey’s picture

Here is the corrected patch. I am trying to attach it but it fails. I filed a site error report.

--- node.module 2005-05-13 11:42:27.466803186 -0400
+++ node.module.orig    2005-05-13 11:41:15.062762697 -0400
@@ -909,7 +909,7 @@
     $join .= $filters[$key]['join'];
   }
   $where = count($where) ? 'WHERE '. implode(' AND ', $where) : '';
-  $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $join .' INNER JOIN {users} u ON n.uid = u.uid '. $where, 50, 0, NULL, $args);
+  $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $join .' INNER JOIN {users} u ON n.uid = u.uid '. $where . " ORDER BY n.changed DESC ", 50, 0, NULL, $args);

   // Make sure the update controls are disabled if we don't have any rows to select from.
   $disabled = !db_num_rows($result);
Bèr Kessels’s picture

+1 A simple fix, that makes the screen behave like one would expect again. great usability improvement with this one line patch.

Uwe Hermann’s picture

Version: 4.6.0 » x.y.z
Status: Active » Fixed

This is fixed in CVS, the line reads $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $join .' INNER JOIN {users} u ON n.uid = u.uid '. $where .' ORDER BY n.changed DESC', 50, 0, NULL, $args);.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)