From a6c6059d88479ab332c852a58f0cc9e6dc4549c4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 23 Mar 2014 15:47:54 -0400 Subject: [PATCH] Fix getlist infinite-scroll --- api/v3/Contact.php | 4 ++-- api/v3/Event.php | 4 ++-- api/v3/Generic/Getlist.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/v3/Contact.php b/api/v3/Contact.php index 73e6f64f94..a60425ffb8 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -891,7 +891,7 @@ WHERE $whereClause /** - * Overrides _civicrm_api3_generic_getlist_params. + * @see _civicrm_api3_generic_getlist_params * * @param $request array */ @@ -934,7 +934,7 @@ function _civicrm_api3_contact_getlist_params(&$request) { } /** - * Overrides _civicrm_api3_generic_getlist_output + * @see _civicrm_api3_generic_getlist_output * * @param $result array * @param $request array diff --git a/api/v3/Event.php b/api/v3/Event.php index 47194379da..37979f81ed 100644 --- a/api/v3/Event.php +++ b/api/v3/Event.php @@ -233,7 +233,7 @@ function _civicrm_api3_event_getisfull(&$event, $event_id) { /** - * Overrides _civicrm_api3_generic_getlist_params. + * @see _civicrm_api3_generic_getlist_params. * * @param $request array */ @@ -248,7 +248,7 @@ function _civicrm_api3_event_getlist_params(&$request) { } /** - * Overrides _civicrm_api3_generic_getlist_output + * @see _civicrm_api3_generic_getlist_output * * @param $result array * @param $request array diff --git a/api/v3/Generic/Getlist.php b/api/v3/Generic/Getlist.php index 779c4c0738..6cc4943128 100644 --- a/api/v3/Generic/Getlist.php +++ b/api/v3/Generic/Getlist.php @@ -53,9 +53,9 @@ function civicrm_api3_generic_getList($apiRequest) { $output = array('page_num' => $request['page_num']); // Limit is set for searching but not fetching by id - if (!empty($request['params']['limit'])) { + if (!empty($request['params']['options']['limit'])) { // If we have an extra result then this is not the last page - $last = $request['params']['limit'] - 1; + $last = $request['params']['options']['limit'] - 1; $output['more_results'] = isset($values[$last]); unset($values[$last]); } @@ -117,7 +117,7 @@ function _civicrm_api3_generic_getList_defaults($entity, &$request) { $request['id'] = explode(',', $request['id']); } // Don't run into search limits when prefilling selection - unset($params['limit'], $params['offset'], $request['params']['limit'], $request['params']['offset']); + unset($params['options']['limit'], $params['options']['offset'], $request['params']['options']['limit'], $request['params']['options']['offset']); $params[$request['id_field']] = is_array($request['id']) ? array('IN' => $request['id']) : $request['id']; } $request['params'] += $params; -- 2.25.1