From bfcbdccfabec186e758d46ebc355defa9dd621d2 Mon Sep 17 00:00:00 2001
From: Jaap Jansma <jaap@edeveloper.nl>
Date: Fri, 13 Mar 2015 14:37:50 +0100
Subject: [PATCH] api changes for managed entities

---
 api/v3/CiviRuleAction/Create.php    | 2 +-
 api/v3/CiviRuleCondition/Create.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/api/v3/CiviRuleAction/Create.php b/api/v3/CiviRuleAction/Create.php
index 810d640..01a1edc 100755
--- a/api/v3/CiviRuleAction/Create.php
+++ b/api/v3/CiviRuleAction/Create.php
@@ -25,7 +25,7 @@ function civicrm_api3_civi_rule_action_create($params) {
   if (!isset($params['id']) && empty($params['label'])) {
     return civicrm_api3_create_error('Label can not be empty when adding a new CiviRule Action');
   }
-  if (empty($params['class_name'])) {
+  if (empty($params['class_name']) && !isset($params['id'])) {
     return civicrm_api3_create_error('Class_name can not be empty');
   }
   /*
diff --git a/api/v3/CiviRuleCondition/Create.php b/api/v3/CiviRuleCondition/Create.php
index a838e6d..ef3f3a1 100755
--- a/api/v3/CiviRuleCondition/Create.php
+++ b/api/v3/CiviRuleCondition/Create.php
@@ -26,7 +26,7 @@ function civicrm_api3_civi_rule_condition_create($params) {
   if (!isset($params['id']) && empty($params['label'])) {
     return civicrm_api3_create_error('Label can not be empty when adding a new CiviRule Condition');
   }
-  if (empty($params['class_name'])) {
+  if (empty($params['class_name']) && !isset($params['id'])) {
     return civicrm_api3_create_error('Class_name can not be empty');
   }
   /*
-- 
GitLab