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

Chained call event-loc block returns an error if no loc block exists.

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5.8, 4.6, 4.7
    • Fix Version/s: 4.6.7
    • Component/s: CiviCRM API
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      If you try to get an event and its loc block with a chained call, like this:

      $result = civicrm_api3('Event', 'getsingle', array(
      'sequential' => 1,
      'return' => "title,loc_block_id",
      'id' => 1000,
      'api.LocBlock.get' => array('id' => "\$value.loc_block_id"),
      ));

      the API returns an error if the event doesn't have a loc block:

      { "error_field":"id", "type":"integer", "error_code":2001, "entity":"Event", "action":"get", "is_error":1, "error_message":"Error in call to LocBlock_get : id is not a valid integer" }

      See also this forum thread: http://forum.civicrm.org/index.php/topic,36113.0.html

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: