From 19ce72a0e6f49b6789207441c68fd3f257642914 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 11 Nov 2024 14:12:04 -0100 Subject: [PATCH] fix: Ensure progress entry is correctly added to database --- code/web/sys/Community/CampaignMilestoneProgressEntry.php | 4 +++- code/web/sys/DBMaintenance/community_engagement_updates.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/web/sys/Community/CampaignMilestoneProgressEntry.php b/code/web/sys/Community/CampaignMilestoneProgressEntry.php index bbe9238d83..49a2224d6f 100644 --- a/code/web/sys/Community/CampaignMilestoneProgressEntry.php +++ b/code/web/sys/Community/CampaignMilestoneProgressEntry.php @@ -6,6 +6,7 @@ class CampaignMilestoneProgressEntry extends DataObject public $__table = 'ce_campaign_milestone_progress_entries'; public $id; public $userId; + public $ce_campaign_id; public $ce_milestone_id; public $ce_campaign_milestone_users_progress_id; public $tableName; @@ -29,7 +30,8 @@ class CampaignMilestoneProgressEntry extends DataObject public function initialize(CampaignMilestone $campaignMilestone, $args = null) { - $this->ce_milestone_id = $campaignMilestone->ce_milestone_id; + $this->ce_milestone_id = $campaignMilestone->milestoneId; + $this->ce_campaign_id = $campaignMilestone->campaignId; if (!$args) return; diff --git a/code/web/sys/DBMaintenance/community_engagement_updates.php b/code/web/sys/DBMaintenance/community_engagement_updates.php index d749e4d1dd..db4a2170b2 100644 --- a/code/web/sys/DBMaintenance/community_engagement_updates.php +++ b/code/web/sys/DBMaintenance/community_engagement_updates.php @@ -60,7 +60,7 @@ function getCommunityEngagementUpdates() { "CREATE TABLE IF NOT EXISTS ce_campaign_milestone_progress_entries ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, userId INT NOT NULL, - ce_campaign_id INT NOT NULL, #TODO: this may not be needed + ce_campaign_id INT NOT NULL, ce_milestone_id INT NOT NULL, ce_campaign_milestone_users_progress_id INT NOT NULL, tableName VARCHAR(100),