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:
Stig Lindqvist 2013-03-29 20:01:52 +13:00
parent 3ff103a04c
commit 3aced1151f

View File

@ -92,13 +92,13 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
}
$filterArguments = $state->Columns->toArray();
$dataListClone = null;
$dataListClone = clone($dataList);
foreach($filterArguments as $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) {