The links in the recent posts block don't work if there are multiple comment pages sorted by "oldest first".

The code in the block needs to take into account user comment preferences (sort order, posts per page) in order to work. As it is now, it is pretty much broken.

CommentFileSizeAuthor
#1 recent.patch1.66 KByossarian

Comments

yossarian’s picture

Title: Recent posts block links invalid if not on first page » Recent comments block links invalid if not on first page
StatusFileSize
new1.66 KB

This fixes the bad links in recent comments against the CVS version.

I never made a patch before, if it's not right format, please comment.

chx’s picture

Please see http://drupal.org/patch . We are using unified diff format, with a switch to make it easier to read: diff -u -F^f old_file new_file

dries’s picture

Please note that comment_num_all is an expensive function call.

Also, where does that '- 10' come from?

yossarian’s picture

-10: sometimes the new comment is the last on a "full" page, and without -10, the link goes one page too far to a non-existent page.

if there's a better way than comment_num_all to count comments, what is it?

yossarian’s picture

Make a separate query to node_comment_statistics?

dries’s picture

This problem exists elsewhere so we would be better off with a function that can generate comment URLs (eg. comment_url()).

killes@www.drop.org’s picture

Priority: Critical » Normal

The patch does not apply anymore. Also, Dries didn't like the implementation.

robin monks’s picture

This is a DUPLICATE of bug http://drupal.org/node/6162

Robin