[REF] Replace incorrect usage of array_key_exists with property_exists in Group BAO...
authorSeamus Lee <seamuslee001@gmail.com>
Sun, 14 Jun 2020 01:43:25 +0000 (11:43 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 14 Jun 2020 01:43:25 +0000 (11:43 +1000)
CRM/Contact/BAO/Group.php

index ec214b8142010ba25c5b9cc44b1597245f0c7fe9..0722920a6f79df2eddd98a38bff55220c9293fd5 100644 (file)
@@ -912,7 +912,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
       $action = array_sum(array_keys($newLinks));
 
       // CRM-9936
-      if (array_key_exists('is_reserved', $object)) {
+      if (property_exists($object, 'is_reserved')) {
         //if group is reserved and I don't have reserved permission, suppress delete/edit
         if ($object->is_reserved && !$reservedPermission) {
           $action -= CRM_Core_Action::DELETE;
@@ -921,7 +921,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
         }
       }
 
-      if (array_key_exists('is_active', $object)) {
+      if (property_exists($object, 'is_active')) {
         if ($object->is_active) {
           $action -= CRM_Core_Action::ENABLE;
         }