We have moved to Github. Please open tickets there.

Opened 4 years ago

Closed 4 years ago

#1720 closed Defect (fixed)

GROUP Forum Plugin - When Admin edits a post he owns it afterwards

Reported by: Dahaniel Owned by:
Priority: normal Milestone:
Component: Forums Version:
Severity: Keywords: group forum
Cc: brettp Difficulty:

Description

When I as an admin edit a post in a group forum, I am displayed as creator of the post.

The creator should be kept, optionally a "edited by: at:" could be added to the post. (but this should be optional)

Change History (7)

comment:1 Changed 4 years ago by Dahaniel

It is actually in 1.2

comment:2 follow-up: Changed 4 years ago by Dahaniel

  • Priority changed from major to critical

Just had a look in the Database. The actual post entity is still belonging to the author but the corresponding annotation now belongs to the editor (me in this case) which makes ma appear as the author in the forum.
For now I fixed it manually but I think the owner should not change upon editing.

comment:3 in reply to: ↑ 2 Changed 4 years ago by kevinjardine

I believe that the fix is to delete line line 29 in

mod/groups/actions/forums/edittopic.php

This is:

$user = $_SESSION['user']->getGUID();

It is incorrect to set the user to the currently logged in user as
this is used to update the annotation.

After line 36, which is:

$topic = get_entity($topic_guid);

add:

{{$user = $topic->getOwner();}}

comment:4 Changed 4 years ago by kevinjardine

D!*n trac.

This should have been:

I believe that the fix is to delete line line 29 in

mod/groups/actions/forums/edittopic.php

This is:

$user = $_SESSION['user']->getGUID();

It is incorrect to set the user to the currently logged in user as this is used to update the annotation.

After line 36, which is:

$topic = get_entity($topic_guid);

add:

$user = $topic->getOwner();

comment:5 Changed 4 years ago by kevinjardine

Just as an aside - I think that the behaviour of update_annotation seems a little strange.

All the parameters are required, even if you don't actually want to change the owner or access_id.

If you set the owner to 0, the function sets the owner to the current logged-in user. Should not the default behaviour of an update function be to leave the values unchanged?

Also, if the update trigger fails, the code appears to delete the annotation. Should not an update failure actually mean that the annotation should be restored to its previous value?

comment:6 Changed 4 years ago by marcus

  • Priority changed from critical to major

comment:7 Changed 4 years ago by marcus

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