Description of problem: When the last comment in a bugzilla is private and the user is not allowed to view it, then the link "last comment" does not work, because it points to an non-existing anchor of the hidden comment. Steps to Reproduce: 1. Log out from bugzilla 2. Open a bug, where the last comment is private 3. Hit the "last comment" link Actual results: Nothing happens. Expected results: Jump to last visible/public comment.
Created attachment 331168 [details] Patch to fix last comment link when private comments are present (v1) Submitting a patch to fix this issue. We are not properly counting the comments if their are private ones and the user cannot see it. So the last comment link will have the wrong comment number reference. The patch first looks at all of the comments and does the number of comments that are visible instead of using the total number of comments. Please review Noura. Dave
Comment on attachment 331168 [details] Patch to fix last comment link when private comments are present (v1) Hey Dave, The patch works good if the last comment was a private comment, but then it is broken if there were private comments between the comments and the last one was public, it doesn't work, so you can try to make the last comment public the comment before the last comment private then for non logged in user or non authorized the link will not work.
Created attachment 331762 [details] Patch to fix last comment link when private comments are present (v2) Thanks Noura. I missed that case in my testing. This patch seems better. Please take a look. Dave
Comment on attachment 331762 [details] Patch to fix last comment link when private comments are present (v2) Hey Dave, Looks good and works well with all my tests. Thanks, Noura
Thanks Noura. Committed to CVS and will be in the next update. Dave
Works great, thanks for the quick fix!