Bug 484216 - Last comment link does not work when last comment is private
Summary: Last comment link does not work when last comment is private
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: User Interface
Version: 3.2
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-05 13:53 UTC by Petr Šplíchal
Modified: 2016-06-01 01:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-16 16:21:35 UTC
Embargoed:


Attachments (Terms of Use)
Patch to fix last comment link when private comments are present (v1) (1.38 KB, patch)
2009-02-06 21:39 UTC, 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 21:09 UTC, David Lawrence
nelhawar: review+
Details | Diff

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!


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