From e9fc5df7639e18607ddfdf47230f46d86bea25d0 Mon Sep 17 00:00:00 2001 From: Ruben Carlo Benante Date: Wed, 8 Jul 2026 20:18:38 -0300 Subject: [PATCH] activity-stream bugfix userid not zero, use the creator --- Model/RecoRecoModel.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Model/RecoRecoModel.php b/Model/RecoRecoModel.php index 456945f..9b7cac5 100644 --- a/Model/RecoRecoModel.php +++ b/Model/RecoRecoModel.php @@ -84,14 +84,15 @@ class RecoRecoModel extends Base } // Native wins: if the card became native-recurring, RecoReco yields (decision 13). Leave a - // visible trail in the task's activity stream (creator_id 0 = system action). + // visible trail in the task's activity stream, attributed to the card's owner (creator_id has + // a FK to users, so a system id like 0 would make the insert fail silently -- no user 0). if ($task['recurrence_status'] != TaskModel::RECURRING_STATUS_NONE) { $this->taskMetadataModel->save($task_id, array('recoreco_enabled' => 0)); $this->logger->info('RecoReco: disabled on task '.$task_id.' (now native-recurring)'); $this->projectActivityModel->createEvent( (int) $task['project_id'], $task_id, - 0, + (int) $task['creator_id'], 'recoreco.task.disable', array('task' => array('id' => $task_id, 'title' => $task['title'])) ); @@ -260,11 +261,12 @@ class RecoRecoModel extends Base $payload = array('source_task_id' => (int) $template['id'], 'new_task_id' => (int) $newId); $this->hook->reference('recoreco:task:spawned', $payload); - // Record the spawn in the clone's activity stream (creator_id 0 = system action). + // Record the spawn in the clone's activity stream, attributed to the template's owner + // (creator_id has a FK to users, so a system id like 0 would silently fail the insert). $this->projectActivityModel->createEvent( (int) $template['project_id'], $newId, - 0, + (int) $template['creator_id'], 'recoreco.task.spawn', array( 'task' => array('id' => $newId, 'title' => $template['title']),