extension-compatibility - Update DB state of force-uninstalled extensions
authorTim Otten <totten@civicrm.org>
Sun, 6 Oct 2019 16:49:16 +0000 (17:49 +0100)
committerTim Otten <totten@civicrm.org>
Sun, 6 Oct 2019 16:49:16 +0000 (17:49 +0100)
Note:
1. This is more advisory than functional - the functionality is really in the runtime bits
   in the previous commits.
2. Technically, this is more of a disable, but we should keep the record around in
   `civicrm_extension` so that we know the old schema revision.

CRM/Upgrade/Form.php

index 5880076991e8cd3ac5e4803de5d37ec51476425e..e7159de55e6fe6c7e19b38d56b5551f9dcd44c0b 100644 (file)
@@ -673,6 +673,11 @@ SET    version = '$version'
             $messages[] = ts('The obsolete extension %1 could not be removed due to an error. It is recommended to remove this extension manually.', [1 => $key]);
           }
         }
+        if (!empty($obsolete['force-uninstall'])) {
+          CRM_Core_DAO::executeQuery('UPDATE civicrm_extension SET is_active = 0 WHERE full_name = %1', [
+            1 => [$key, 'String'],
+          ]);
+        }
       }
     }
     if ($messages) {