CRM-21127 - Fix return properties in api.Event.get
authorColeman Watts <coleman@civicrm.org>
Fri, 15 Sep 2017 13:41:05 +0000 (09:41 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 15 Sep 2017 13:41:05 +0000 (09:41 -0400)
api/v3/Event.php

index 0126280a9602de25bd8de9990cc3eaeecbaf4fd9..0a06e0fa6cb1d921c343b74eac5844302e84fa7a 100644 (file)
@@ -131,16 +131,16 @@ function civicrm_api3_event_get($params) {
   }
 
   $events = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE, 'Event', $sql, TRUE);
-  $options = _civicrm_api3_get_options_from_params($params);
+  $options = _civicrm_api3_get_options_from_params($params, TRUE);
   if ($options['is_count']) {
     return civicrm_api3_create_success($events, $params, 'Event', 'get');
   }
   foreach ($events as $id => $event) {
-    if (!empty($params['return.is_full'])) {
+    if (!empty($options['return']['is_full'])) {
       _civicrm_api3_event_getisfull($events, $id);
     }
     _civicrm_api3_event_get_legacy_support_42($events, $id);
-    if (!empty($options['return'])) {
+    if (!empty($options['return']['price_set_id'])) {
       $events[$id]['price_set_id'] = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $id);
     }
   }