Flush metadata cache on event edit
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 6 Oct 2021 03:42:21 +0000 (16:42 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 6 Oct 2021 03:43:50 +0000 (16:43 +1300)
CRM/Event/BAO/Event.php

index 6baa7a793d492fbcb2e4e6cda97cc49394eb6494..50982dc3864a35e98f98b779acbff6a2704ea76d 100644 (file)
@@ -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,