Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19894

API: Chaining EntityTag.delete does not work

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.7.15
    • Fix Version/s: None
    • Component/s: CiviCRM API
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      Have a look at this API call:

      $result = civicrm_api3('EntityTag', 'get', array(
      'sequential' => 1,
      'return' => array("id", "entity_id"),
      'options' => array('limit' => 1),
      'api.EntityTag.delete' => array('id' => "\$value.id", 'entity_id' => "\$value.entity_id"),
      ));

      This should get one EntityTag (limit 1), and delete it using a chained API call. (I explicitely mention entity_id, because this is required since c683526)

      Here is the result I get:

      {

      "is_error": 0,
      "version": 3,
      "count": 1,
      "id": 3096,
      "values": [
      {
      "id": "3096",
      "entity_id": "1",
      "api.EntityTag.delete":

      { "is_error": 1, "not_removed": 2, "removed": 0, "total_count": 2, "error_message": "Unable to remove tags" }

      }
      ]
      }

      So 'api.EntityTag.delete' says 'not_removed':2, although I requested to remove only one EntityTag. I reproduced this as user 1 in the API explorer, so it is not a permission issue.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              johanv Johan Vervloet
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: