Bug 484216

Summary: Last comment link does not work when last comment is private
Product: [Community] Bugzilla Reporter: Petr Šplíchal <psplicha>
Component: User InterfaceAssignee: David Lawrence <dkl>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 3.2CC: ohudlick
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-16 16:21:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fix last comment link when private comments are present (v1)
nelhawar: review-
Patch to fix last comment link when private comments are present (v2) nelhawar: review+

Description Petr Šplíchal 2009-02-05 13:53:25 UTC
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 21:39:39 UTC
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-12 04:29:42 UTC
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 21:09:44 UTC
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 23:17:44 UTC
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 16:21:35 UTC
Thanks Noura. Committed to CVS and will be in the next update.

Dave

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