It appears that when going to the blog page (www.mysite.com/blog)on a Drupal site, that it displays the entries on the page by entry number (ie: order they were entered) and not by published date. While the majority of the time this is fine, I have a few times where I remembered a blog I wanted to write and preferred it be posted on a specific day (or before another entry), but just modifying the posting date field does not change the order it appears on the blog page. Since Drupal allows you to edit the Authored On field, I would assume it would have ordered by this field, but mine doesn't and I don't see (without php hacking) how I can do this. Not sure if this is a "bug" or whether this is a new feature request (with maybe an admin option for how to sort).

Comments

nernst’s picture

this message discusses this in some detail. Not sure what status of the patch is however.

neil

Anonymous’s picture

Thanks! That message contains the patch attached to it (that .bin link on it). The patch was for pre-4.2.0 (either 4.1.0 or CVS, not sure) but I was able to change the blog.module in my 4.2.0 version and now have this working.

Basically:
* search for the first two occurances of "ORDER BY n.nid" and change those to "ORDER BY n.created, n.nid" (no quotes) on each.
* search for the first two occurances of "ORDER BY nid" and change to "ORDER BY created" on each
* search for the final occurance of "ORDER BY n.nid" and change to "ORDER BY n.created".

Wonder why this was left out of 4.2.0 release if it was patched? Was this not an official patch? How can we make it official? As was stated, users don't care (and shouldn't know) about NID's, so only sorting by date really makes sense (or if there is a reason for this, maybe make it a selectable option for the blog module).

(BTW: This is mike@frazierhome.net, but I can't seem to login to this site right now)

Dries’s picture

You can use "ORDER BY n.created" instead of "ORDER BY n.created, n.nid". Please send a new patch to the mailing list and we'll consider including it. When you send the patch, include the link to the old mail/patch. Thanks Mike.

minimism’s picture

Just finding that this is a feature that I'd like with my blog - is it likely to be integrated into the main branch, or should I just patch my own blog.module??

cheers,

john..

wal’s picture

I did this with my blog module (4.4) and it worked flawlessly.

--Bill