Sometimes a comment becomes editable again

Bug #1183648 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Confirmed
Low
Unassigned

Bug Description

When you edit a comment, there's a notice on the editing screen saying that a comment is editable only as long as it is less than 10 minutes old and there is no younger comment after it. But I have noticed comments becoming editable again even after others are posted after them.

I suspect it may be because clicking the "make public" link for a comment changes its "last edited" value to be newer than the date of the comments below it. If this is the case, we should check for "younger comments" by comment order, not by a date field.

Tags: comments
Aaron Wells (u-aaronw)
Changed in mahara:
importance: Undecided → Medium
status: New → Triaged
importance: Medium → Low
Robert Lyon (robertl-9)
Changed in mahara:
status: Triaged → Confirmed
Revision history for this message
Robert Lyon (robertl-9) wrote :

Yes it looks like a comment that starts off private then made public or starts off public then made private does not respect the youngest comment situation.

Looking at the code the 'youngest comment' is selected by last_public_comment() function, which wants the private = 0 and newest creation time. So when a comment changes from private = 0 to private = 1 the next youngest becomes the youngest.
So you can end up with two (or more) logically being allowed to be edited simply by adding some comments and then toggling the public/private checkbox for each latest 'public' one.

To fix we need to have a more robust check done in last_public_comment() to take in account comments that have had public/private changed and if they are pending moderation etc.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.