From 351b0f6bc72a40398b384be316e0c37283e0679e Mon Sep 17 00:00:00 2001 From: eileenmcnaughton Date: Wed, 5 Aug 2015 10:39:25 +0000 Subject: [PATCH] CRM-15904 fix sequential with reload --- CRM/Utils/API/ReloadOption.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/API/ReloadOption.php b/CRM/Utils/API/ReloadOption.php index 162d408516..af863ab62f 100644 --- a/CRM/Utils/API/ReloadOption.php +++ b/CRM/Utils/API/ReloadOption.php @@ -80,6 +80,7 @@ class CRM_Utils_API_ReloadOption implements API_Wrapper { if (!CRM_Utils_Array::value('is_error', $result, FALSE)) { $reloadMode = $apiRequest['params']['options']['reload']; } + $id = (!empty($apiRequest['params']['sequential'])) ? 0 : $result['id']; } switch ($reloadMode) { @@ -98,16 +99,16 @@ class CRM_Utils_API_ReloadOption implements API_Wrapper { if ($reloadResult['is_error']) { throw new API_Exception($reloadResult['error_message']); } - $result['values'][$result['id']] = array_merge($result['values'][$result['id']], $reloadResult['values'][$result['id']]); + $result['values'][$id] = array_merge($result['values'][$id], $reloadResult['values'][$result['id']]); return $result; case 'selected': $params = array( - 'id' => $result['id'], + 'id' => $id, 'return' => $this->pickReturnFields($apiRequest), ); $reloadResult = civicrm_api3($apiRequest['entity'], 'get', $params); - $result['values'][$result['id']] = array_merge($result['values'][$result['id']], $reloadResult['values'][$result['id']]); + $result['values'][$id] = array_merge($result['values'][$id], $reloadResult['values'][$id]); return $result; default: -- 2.25.1