Commit 9edeab26 authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic
Browse files

Bug 1813200: Wallpost activity passing in confusing 'id' value



When we allowed the wallpost to have embedded images we accidentally
adjusted what was being sent in the wall post activiy object by
including the 'id' value when we didn't need to and this caused
unexpected consequences.

behatnotneeded

Change-Id: Ic1b19320cb1cf0c90131dca9bfe262a95fffdd2f
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent f794dde5
...@@ -233,6 +233,7 @@ EOF; ...@@ -233,6 +233,7 @@ EOF;
'postdate' => db_format_timestamp(time()), 'postdate' => db_format_timestamp(time()),
'text' => clean_html($values['text']), 'text' => clean_html($values['text']),
); );
$activityrecord = clone $record;
$newid = insert_record('blocktype_wall_post', $record, 'id', true); $newid = insert_record('blocktype_wall_post', $record, 'id', true);
...@@ -246,7 +247,7 @@ EOF; ...@@ -246,7 +247,7 @@ EOF;
update_record('blocktype_wall_post', $updatedwallpost, 'id'); update_record('blocktype_wall_post', $updatedwallpost, 'id');
} }
activity_occurred('wallpost', $record, 'blocktype', 'wall'); activity_occurred('wallpost', $activityrecord, 'blocktype', 'wall');
$instance = new BlockInstance($values['instance']); $instance = new BlockInstance($values['instance']);
$owner = $instance->get_view()->get('owner'); $owner = $instance->get_view()->get('owner');
......
...@@ -20,6 +20,8 @@ defined('INTERNAL') || die(); ...@@ -20,6 +20,8 @@ defined('INTERNAL') || die();
* @param string $plugintype * @param string $plugintype
* @param string $pluginname * @param string $pluginname
* @param bool $delay * @param bool $delay
*
* NOTE: If the $data object contains an 'id' property this needs to be the id of the activitytype
*/ */
function activity_occurred($activitytype, $data, $plugintype=null, $pluginname=null, $delay=null) { function activity_occurred($activitytype, $data, $plugintype=null, $pluginname=null, $delay=null) {
try { try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment