[drupal-devel] [bug] Comments per page, links don't go to correct page

killes drupal-devel at drupal.org
Mon Sep 12 21:18:18 UTC 2005


Issue status update for 
http://drupal.org/node/26966
Post a follow up: 
http://drupal.org/project/comments/add/26966

 Project:      Drupal
 Version:      cvs
 Component:    comment.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  jakeg
 Updated by:   killes at www.drop.org
-Status:       active
+Status:       patch (code needs review)

The first patch is an obvious bugfix and shoudl be committed. I don't
understand the rest of the probem, though. paged coments have been
broken for a long time, so it would be nice to see them fixed.




killes at www.drop.org



Previous comments:
------------------------------------------------------------------------

Mon, 18 Jul 2005 15:53:36 +0000 : jakeg

When you, as admin, set the default number of comments per page, the
links to those comments are not updated as they should be.


For example, all links to individual comments still go to
/node/x/#comment-x but comment no. x may not be on that page if x is
bigger than the number of comments per page. Hence the link is wrong.


This includes links from the 'recent comments' block and also very
importantly after someone has submitted a new comment, they should be
taken to their comment but if their new comment isn't on the first page
then they have the same problem.


This is a *big* problem if you have discussion/comment threads of more
than about 100 posts (some threads on my site are over 300 posts) and
hence you can't sensibly include them all on one page.




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

Wed, 27 Jul 2005 20:44:29 +0000 : jakeg

bump. I consider this to be quite important. Its definitely a 'bug' and
not a feature request as when you click a link to a certain comment you
expect to get to that comment, as the # in the URL would suggest.




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

Tue, 09 Aug 2005 08:19:03 +0000 : jakeg

bump - can anyone help? Its a major problem for me.




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

Sun, 21 Aug 2005 06:58:32 +0000 : robertDouglass

Changing this to CVS and widening the scope.


When I set the comments per page at 10, in the CVS version, and then
make a node with over 10 comments, I get no pager links to other pages
of comments, but rather a useless "moderate comments" button. In short,
in my install from yesterday, comments are foobar.




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

Thu, 25 Aug 2005 23:49:03 +0000 : tostinni

Attachment: http://drupal.org/files/issues/comment_page.patch (1.02 KB)

"When I set the comments per page at 10, in the CVS version, and then
make a node with over 10 comments, I get no pager links to other pages
of comments, but rather a useless "moderate comments" button. In short,
in my install from yesterday, comments are foobar.

"
Ok I got a patch for this, it's just a smal mistake in the order of the
pager_query arguments.


I'll have a look at the comment link tomorrow.




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

Fri, 26 Aug 2005 22:49:52 +0000 : tostinni

Regarding the block comment :
"When you, as admin, set the default number of comments per page, the
links to those comments are not updated as they should be.


For example, all links to individual comments still go to
/node/x/#comment-x but comment no. x may not be on that page if x is
bigger than the number of comments per page. Hence the link is wrong.

"
In HEAD, it seems that links goes to /node/$nid#comment-$cid so I think
there's a mistake here, it should be /node/$nid/$cid#comment-$cid if you
want to see the individual comment.


But if we want to see global comment thread and move the focus to the
current comment, we should consider doing something like
node/$nid?page=$pid&comments_per_page=10#comment-$cid
$nid, $pid, $cid are variable defining the comment.


What do you think about this ?




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

Tue, 30 Aug 2005 17:29:51 +0000 : tostinni

Attachment: http://drupal.org/files/issues/comment_page_0.patch (2.32 KB)

Here comes a new patch, and for the moment, here will stop my
contributions.
I need help and review because I don't know how to fix the next bugs.


What do my patch :
- correct the pager_query function to see the list of comment as
described in #4
- correct the links on the title of the comment when seeing the
comments. Currently they are built like : /$nid#comment-$cid this
doesn't work when a page is specified, so we have to look if URL get
extra parameters like "page=1" to rebuilt the url link. So I modified
phptemplate engine to change the comment theme function in order it
takes these parameters.


Now I'm still blocked because I don't have any idea how to solve the
biggest problems in comment_block and about redirecting user after
posting his comment.
This is not so hard to tell, but I don't know a clean way to do this :
In comment_block, the problem is that when we make the link to last
comment, we didn't know the page where the post is supposed to be (this
only happen when we have a threaded mode). So we should find it. Yes,
but the problem is how... We should do an other query, like the one we
made in comment_render and then find the position in thread of the
current comment to add the page fragment to the url.


It happens pretty much the same in the redirection after writing a
comment.


Any odeas on how we should make this ?
4.7 is coming... :)







More information about the drupal-devel mailing list