mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG: GridFieldFilterHeader only filters on last filter
GridFieldFilterHeader only filters on the last filter argument because it keeps recloning the original datalist
This commit is contained in:
parent
3ff103a04c
commit
3aced1151f
@ -92,13 +92,13 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
|
|||||||
}
|
}
|
||||||
|
|
||||||
$filterArguments = $state->Columns->toArray();
|
$filterArguments = $state->Columns->toArray();
|
||||||
$dataListClone = null;
|
$dataListClone = clone($dataList);
|
||||||
foreach($filterArguments as $columnName => $value ) {
|
foreach($filterArguments as $columnName => $value ) {
|
||||||
if($dataList->canFilterBy($columnName) && $value) {
|
if($dataList->canFilterBy($columnName) && $value) {
|
||||||
$dataListClone = $dataList->filter($columnName.':PartialMatch', $value);
|
$dataListClone = $dataListClone->filter($columnName.':PartialMatch', $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ($dataListClone) ? $dataListClone : $dataList;
|
return $dataListClone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHTMLFragments($gridField) {
|
public function getHTMLFragments($gridField) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user