mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #5214 from tractorcow/pulls/3.1/fix-array-values
Do not hang on nested parameters in search context
This commit is contained in:
commit
863b737717
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user