From 77d03cb4dda7adef031793c67d65b185af0bcad6 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 4 Jun 2019 18:18:24 -0400 Subject: [PATCH] Fix enable components form validation --- CRM/Admin/Form/Setting/Component.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Admin/Form/Setting/Component.php b/CRM/Admin/Form/Setting/Component.php index 2fd2ea3d59..60d024b2b7 100644 --- a/CRM/Admin/Form/Setting/Component.php +++ b/CRM/Admin/Form/Setting/Component.php @@ -66,12 +66,12 @@ class CRM_Admin_Form_Setting_Component extends CRM_Admin_Form_Setting { $errors = []; if (array_key_exists('enable_components', $fields) && is_array($fields['enable_components'])) { - if (in_array('CiviPledge', $fields['enable_components']) && - !in_array('CiviContribute', $fields['enable_components']) + if (!empty($fields['enable_components']['CiviPledge']) && + empty($fields['enable_components']['CiviContribute']) ) { $errors['enable_components'] = ts('You need to enable CiviContribute before enabling CiviPledge.'); } - if (in_array('CiviCase', $fields['enable_components']) && + if (!empty($fields['enable_components']['CiviCase']) && !CRM_Core_DAO::checkTriggerViewPermission(TRUE, FALSE) ) { $errors['enable_components'] = ts('CiviCase requires CREATE VIEW and DROP VIEW permissions for the database.'); -- 2.25.1