From c3733bf533daf1aef3bb6f72074c4318c917cb7f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 22 Feb 2018 12:15:24 -0800 Subject: [PATCH] Extension.get API - Only apply special filters once (key/keys/full_name) Filtering extensions by key is a good idea -- so good we have three ways to do it! ;) All of these fields accept a `string|array` input, which is different from the typical filtering supported by `_civicrm_api3_basic_array_get()` (which only matches on values)... If you happen to choose a basic filter that passes both filters (i.e. a simple string-match), then it works. But if you choose a filter where they behave differnetly (i.e. an array), then you get weird results. --- api/v3/Extension.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/v3/Extension.php b/api/v3/Extension.php index 441a7f5a88..6926aa8bfb 100644 --- a/api/v3/Extension.php +++ b/api/v3/Extension.php @@ -368,7 +368,13 @@ function civicrm_api3_extension_get($params) { $result[] = $info; } } - $filterableFields = array('id', 'key', 'type', 'status', 'path'); + + // These fields have been filtered already, and they have special semantics. + unset($params['key']); + unset($params['keys']); + unset($params['full_name']); + + $filterableFields = array('id', 'type', 'status', 'path'); return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', $filterableFields); } -- 2.25.1