Do not hang on nested parameters in search context

Backport of 0b5a573 for 3.2 that does not add a new API, as
required by #5056 to be semver compatible.
This commit is contained in:
Nicola Fontana 2016-02-28 21:40:34 +01:00 committed by Damian Mooyman
parent cdedee130a
commit 11561aeb54

View File

@ -226,7 +226,15 @@ abstract class ModelAdmin extends LeftAndMain {
public function getList() { public function getList() {
$context = $this->getSearchContext(); $context = $this->getSearchContext();
$params = $this->request->requestVar('q'); $params = $this->getRequest()->requestVar('q');
if(is_array($params)) {
$trimRecursive = function($v) use(&$trimRecursive) {
return is_array($v) ? array_map($trimRecursive, $v) : trim($v);
};
$params = $trimRecursive($params);
}
$list = $context->getResults($params); $list = $context->getResults($params);
$this->extend('updateList', $list); $this->extend('updateList', $list);