systopia / de.systopia.xcm

CiviCRM Extended Contact Matcher
Other
5 stars 10 forks source link

Add Tag broken #45

Closed bjendres closed 4 years ago

bjendres commented 5 years ago

Adding a tag that's already there seems to produce an API Exception

pfigel commented 5 years ago

Relevant core issue: https://lab.civicrm.org/dev/core/issues/675 - no fix, unfortunately, since APIv3 is frozen.

We worked around this with a core patch to avoid whack-a-mole in all extensions (though of course a fix within the extension would be cleaner):

diff --git a/api/v3/EntityTag.php b/api/v3/EntityTag.php
index 39a6f8ace4..4512503510 100644
--- a/api/v3/EntityTag.php
+++ b/api/v3/EntityTag.php
@@ -155,10 +155,6 @@ function _civicrm_api3_entity_tag_common($params, $op = 'add') {
       $values['not_removed'] += $nr;
     }
   }
-  if (empty($values['added']) && empty($values['removed'])) {
-    $values['is_error'] = 1;
-    $values['error_message'] = "Unable to $op tags";
-  }
   return $values;
 }
bjendres commented 4 years ago

released with 1.6

bjendres commented 4 years ago

Released with 1.7