We have moved to Github. Please open tickets there.

Opened 4 years ago

Closed 3 years ago

#1369 closed Defect (Moved to extensions)

Group Forum Topic Edit/Delete Broken!

Reported by: edfactor Owned by:
Priority: high Milestone: Elgg 1.7
Component: Core Version: 1.6
Severity: major Keywords: group, forum
Cc: brettp Difficulty:

Description

In Group Discussions (forums), there is a serious problem that only appears to be a minor problem:

Topics (entities that start discussions) and Posts (which are annotations to discussions) are different things. Also, the initial text of a topic is an annotation of the topic, which is different than the Post annotations.

Here is what goes wrong:

  1. You create a topic
  2. You decide to alter it
  3. You hit the delete button. You get a message saying the "post" is deleted - but it wasn't a post!
  4. You see that the topic title is there. You go to discussions and see it's gone, but... it's still in the river, and if you tagged that post, it will come up when you search by tag.
  5. If you chose edit, that also doesn't work. You can only edit the text of the topic, and not the title or tags.

So what explains this behavior?

The Edit/Delete links on the Topic don't work because they lead to the edit and delete functions for posts. But the posts are annotations and not entities (like topics). You can edit the text because the system says, "change the text for the annotation with this ID" using the post functionality. It then calls an update on the annotation of the topic (which isn't a post) but the update works as it doesn't check to see if it's a post you're updating.

So what's the solution to all this?

  • You need a new "view" ( a file ) for topic that isn't the view for the post, and those edit/delete links need to result in editing and deleting the topic. (attaching this file, needs to go in /mod/groups/views/default/forum)
  • You need a change to the viewposts.php file to direct you to that correct view. (patch included for that and nice divs for striping)

I realize this is a lot of text for this report, but my wife Maureen found this and put a lot of effort into fixing the problem. (I have the Trac account, so I filed it)

I have tested this, and it works. Also, when you add these fixes, you must either hit upgrade.php or do something to clear the view cache as you have a new file (topic.php) that Elgg doesn't know about.

Attachments (2)

topic.php (2.8 KB) - added by edfactor 4 years ago.
New topic view file
1128_viewposts_fix.diff (1.3 KB) - added by edfactor 4 years ago.
Patch file for viewposts.php

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by edfactor

New topic view file

Changed 4 years ago by edfactor

Patch file for viewposts.php

comment:1 Changed 4 years ago by darkwingduck

I was going to report this.

Also, I think the thread should be deleted when the last post is deleted.

comment:3 Changed 3 years ago by brettp

  • Resolution set to Moved to extensions
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.