From 004b18e1d95a9c9f213f16965f39b5ae1cfec073 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 10 Apr 2024 12:16:49 +0200 Subject: [PATCH] fix: [component:restSearch] Restored behavior of searching for org and cluster metadata --- app/Controller/AppController.php | 14 +++++++++++++- app/Controller/Component/RestSearchComponent.php | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 6c2e65259..b84fac808 100755 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -1033,7 +1033,19 @@ class AppController extends Controller $data = array_merge($data, $temp); } else { foreach ($options['paramArray'] as $param) { - if (isset($temp[$param])) { + if (substr($param, -1) == '*') { + $root = substr($param, 0, strlen($param)-1); + foreach ($temp as $existingParamKey => $v) { + $leftover = substr($existingParamKey, strlen($param)-1); + if ( + $root == substr($existingParamKey, 0, strlen($root)) && + preg_match('/^[\w_-. ]+$/', $leftover) == 1 + ) { + $data[$existingParamKey] = $temp[$existingParamKey]; + break; + } + } + } else if (isset($temp[$param])) { $data[$param] = $temp[$param]; } } diff --git a/app/Controller/Component/RestSearchComponent.php b/app/Controller/Component/RestSearchComponent.php index ae8a4a34e..9e8ab024f 100644 --- a/app/Controller/Component/RestSearchComponent.php +++ b/app/Controller/Component/RestSearchComponent.php @@ -144,7 +144,11 @@ class RestSearchComponent extends Component 'retry', 'expiry', 'minimum_ttl', - 'ttl' + 'ttl', + 'org.sector', + 'org.local', + 'org.nationality', + 'galaxy.*', ], 'Object' => [ 'returnFormat',