Fix undeclared property - use locally scoped variable
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 17 Aug 2023 23:24:39 +0000 (11:24 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 17 Aug 2023 23:25:05 +0000 (11:25 +1200)
CRM/Event/Form/ManageEvent.php

index 6eed43ce9d306d1f597d1830719d7d2aca2250f7..1059d3ce403178cc4ba32f496210e7031da145cc 100644 (file)
@@ -191,35 +191,28 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
 
     // Set Done button URL and breadcrumb. Templates go back to Manage Templates,
     // otherwise go to Manage Event for new event or ManageEventEdit if event if exists.
-    $breadCrumb = [];
     if (!$this->_isTemplate) {
+      $breadCrumb = ['title' => ts('Manage Events')];
       if ($this->_id) {
-        $this->_doneUrl = CRM_Utils_System::url(CRM_Utils_System::currentPath(),
+        $breadCrumb['url'] = CRM_Utils_System::url(CRM_Utils_System::currentPath(),
           "action=update&reset=1&id={$this->_id}"
         );
       }
       else {
-        $this->_doneUrl = CRM_Utils_System::url('civicrm/event/manage',
+        $breadCrumb['url'] = CRM_Utils_System::url('civicrm/event/manage',
           'reset=1'
         );
-        $breadCrumb = [
-          [
-            'title' => ts('Manage Events'),
-            'url' => $this->_doneUrl,
-          ],
-        ];
       }
+      CRM_Utils_System::appendBreadCrumb($breadCrumb);
     }
     else {
-      $this->_doneUrl = CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1');
-      $breadCrumb = [
+      CRM_Utils_System::appendBreadCrumb([
         [
           'title' => ts('Manage Event Templates'),
-          'url' => $this->_doneUrl,
+          'url' => CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'),
         ],
-      ];
+      ]);
     }
-    CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
 
   /**