[MGNLFORUM-62] Make it possible to erase the last message of a thread Created: 07/Oct/07  Updated: 02/Dec/13  Resolved: 16/Apr/10

Status: Closed
Project: Forum (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.1

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Jan Haderka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mgnlforum-62.patch     File mgnlforum-62.patch    
Issue Links:
duplicate
is duplicated by MGNLFORUM-93 Can't delete a post from the forum mo... Closed
relation
is related to MGNLFORUM-77 Thread can't be deleted Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

As of now, it cannot be removed because it is still being referenced. It should be feasible to update the lastMessage property of a thread by using the javax.jcr.Node.getSiblings() method to retrieve the previous message ?



 Comments   
Comment by Magnolia International [ 09/Oct/07 ]

Would also need to potentially update the lastMessage prop of the forum node, since MGNLFORUM-25. The problem would then be to update it to the actual last message of the whole forum, not just of the current thread....

Comment by Jan Haderka [ 02/Apr/10 ]

In case someone wants to contribute a patch and needs a headstart ...

Comment by Magnolia International [ 06/Apr/10 ]

comments on the patch:

  • do not delete the thread when attempting to delete the first message. (do nothing or throw an exception instead)
  • since the deleteThread method already has similar mechanisms, reuse/refactor them
  • use the constants for the property names
  • i'm not sure sorting by jcr:date is the best approach, rather than simply taking the last sibling (might not be good for nested messages) - same goes for the current deleteThread implementation. SiblingsHelper might help.
  • see my comment above - we need to fix the "lastMessage" of the forum node too.
Comment by Diana Racho [ 14/Apr/10 ]

Here is an offer for a patch.

Comment by Jan Haderka [ 16/Apr/10 ]

Thanks for the patch. I have refactored it to avoid duplication of code between same processing done for the thread and message deletion and added tests as well.

Comment by Jan Haderka [ 20/Apr/10 ]

just in case there are volunteers for testing: http://repo.magnolia-cms.com/snapshots/info/magnolia/magnolia-module-forum/1.2.1-SNAPSHOT/magnolia-module-forum-1.2.1-20100420.125602-1.jar

Comment by Christoph Meier [ 02/Dec/13 ]

closed, since it has resolved a long time ago

Generated at Mon Feb 12 02:00:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.