From 060096554420d26cedd794b1f15082755902df7d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 6 Oct 2021 16:42:21 +1300 Subject: [PATCH] Flush metadata cache on event edit --- CRM/Event/BAO/Event.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 6baa7a793d..50982dc386 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -154,7 +154,10 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { } $transaction->commit(); - + if (!empty($params['id'])) { + // Note that this will specifically clear cached event tokens. + Civi::cache('metadata')->clear(); + } return $event; } @@ -1093,7 +1096,7 @@ WHERE civicrm_event.is_active = 1 TRUE, $participantParams ); - list($profileValues) = $profileValues; + [$profileValues] = $profileValues; $val = [ 'id' => $gId, 'values' => $profileValues, -- 2.25.1