Bug 484216 - Last comment link does not work when last comment is private
Last comment link does not work when last comment is private
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: User Interface (Show other bugs)
3.2
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-05 08:53 EST by Petr Šplíchal
Modified: 2016-05-31 21:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-16 11:21:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix last comment link when private comments are present (v1) (1.38 KB, patch)
2009-02-06 16:39 EST, David Lawrence
nelhawar: review-
Details | Diff
Patch to fix last comment link when private comments are present (v2) (1.46 KB, patch)
2009-02-12 16:09 EST, David Lawrence
nelhawar: review+
Details | Diff

  None (edit)
Description Petr Šplíchal 2009-02-05 08:53:25 EST
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.
Comment 2 David Lawrence 2009-02-06 16:39:39 EST
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 3 Noura El hawary 2009-02-11 23:29:42 EST
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.
Comment 4 David Lawrence 2009-02-12 16:09:44 EST
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 5 Noura El hawary 2009-02-15 18:17:44 EST
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
Comment 6 David Lawrence 2009-02-16 11:21:35 EST
Thanks Noura. Committed to CVS and will be in the next update.

Dave
Comment 8 Petr Šplíchal 2009-02-20 08:35:17 EST
Works great, thanks for the quick fix!

Note You need to log in before you can comment on or make changes to this bug.