From 4827c43c056e545ba3a79ddb23dad29f0c4ad6a8 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 24 Mar 2016 20:46:00 -0700 Subject: [PATCH] CRM-16243 - Extension API - Automatically enable dependencies This applies to the `install` and `enable` actions. Handling `download` is a different task. --- api/v3/Extension.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/v3/Extension.php b/api/v3/Extension.php index b618a37e83..aa0e38d912 100644 --- a/api/v3/Extension.php +++ b/api/v3/Extension.php @@ -53,7 +53,8 @@ function civicrm_api3_extension_install($params) { } try { - CRM_Extension_System::singleton()->getManager()->install($keys); + $manager = CRM_Extension_System::singleton()->getManager(); + $manager->install($manager->findInstallRequirements($keys)); } catch (CRM_Extension_Exception $e) { return civicrm_api3_create_error($e->getMessage()); @@ -124,7 +125,8 @@ function civicrm_api3_extension_enable($params) { return civicrm_api3_create_success(); } - CRM_Extension_System::singleton()->getManager()->enable($keys); + $manager = CRM_Extension_System::singleton()->getManager(); + $manager->enable($manager->findInstallRequirements($keys)); return civicrm_api3_create_success(); } -- 2.25.1