From d286be109c580a76fc6cbbd3b49dd5836679553f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 5 Jul 2023 12:42:47 -0700 Subject: [PATCH] (dev/core#4391) Prohibit uninstallation of core components --- CRM/Extension/Manager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index 6b1f1cfb59..921983dd14 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -455,6 +455,12 @@ class CRM_Extension_Manager { // TODO: to mitigate the risk of crashing during installation, scan // keys/statuses/types before doing anything + // Component data still lives inside of core-core. Uninstalling is nonsensical. + $notUninstallable = array_intersect($keys, $this->mapper->getKeysByTag('component')); + if (count($notUninstallable)) { + throw new CRM_Extension_Exception("Cannot uninstall extensions which are tagged as components: " . implode(', ', $notUninstallable)); + } + $this->addProcess($keys, 'uninstall'); foreach ($keys as $key) { -- 2.25.1