[REF] Minor code simplification
[civicrm-core.git] / CRM / Core / ManagedEntities.php
index f5ee0c38cabce0fff141284064a5869aba9b488a..cf47fa6918bd14986f4c4e656c8ea927c5903ce5 100644 (file)
@@ -112,10 +112,15 @@ class CRM_Core_ManagedEntities {
   /**
    * Identify any enabled/disabled modules. Add new entities, update
    * existing entities, and remove orphaned (stale) entities.
+   * @param bool $ignoreUpgradeMode
    *
    * @throws Exception
    */
-  public function reconcile() {
+  public function reconcile($ignoreUpgradeMode = FALSE) {
+    // Do not reconcile whilst we are in upgrade mode
+    if (CRM_Core_Config::singleton()->isUpgradeMode() && !$ignoreUpgradeMode) {
+      return;
+    }
     if ($error = $this->validate($this->getDeclarations())) {
       throw new Exception($error);
     }
@@ -259,7 +264,8 @@ class CRM_Core_ManagedEntities {
     if ($doUpdate) {
       $defaults = [
         'id' => $dao->entity_id,
-        'is_active' => 1, // FIXME: test whether is_active is valid
+      // FIXME: test whether is_active is valid
+        'is_active' => 1,
       ];
       $params = array_merge($defaults, $todo['params']);
       $result = civicrm_api($dao->entity_type, 'create', $params);