Problem with plugin discussion

Hi,

in a group discussion, the person (non admin) which created  a discussion can modify the comments of other people...

It could be a big problem for us...

I didn't find any option in settings to avoid that...

How can I do ?

 

Thx a lot

  • This is an issue indeed (see https://github.com/Elgg/Elgg/issues/9762). There's no setting to change this behaviour. And a fix is also not trivial so I can only suggest to wait until the issue gets fixed in Elgg core.

  • Thanks for answer.

    Hope it will be fix soon :)

  • It might be not too complicated to fix this for discussions after all. I'm currently testing but any modification might only make it in Elgg 3.0 and not into previous versions.

    In start.php of the Discussions plugin is the function discussion_can_edit_reply($hook, $type, $return, $params). Comment out the lines as shown in the following in bold

    function discussion_can_edit_reply($hook, $type, $return, $params) {
        /** @var $reply ElggEntity */
        $reply = $params['entity'];
        $user = $params['user'];
    
        if (!elgg_instanceof($reply, 'object', 'discussion_reply')) {
            return $return;
        }
    
        if ($reply->owner_guid == $user->guid) {
            return true;
        }
    
        $discussion = $reply->getContainerEntity();
    //     if ($discussion->owner_guid == $user->guid) {
    //         return true;
    //     }
    
        $container = $discussion->getContainerEntity();
        if (elgg_instanceof($container, 'group') && $container->owner_guid == $user->guid) {
            return true;
        }
    
        return false;
    }

    This should result in edit/delete permissions of discussion replies to remain only for admins, group owners and the user who posted the reply and no longer for the user who started the discussion topic.

  • I replaced true by false and now it works.

     

    Thanks a lot