mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: open ticket 7603 fixing search filtering - thought I should initialise $dataListClone
This commit is contained in:
parent
630ab878c9
commit
e096c297b8
@ -362,11 +362,14 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
// TODO Handle through GridState within field - currently this state set too late to be useful here (during request handling)
|
||||
$parentID = $this->controller->getRequest()->requestVar('ParentID');
|
||||
|
||||
$fileFieldConfig = GridFieldConfig::create();
|
||||
$fileFieldConfig->addComponent(new GridFieldSortableHeader());
|
||||
$fileFieldConfig->addComponent(new GridFieldFilterHeader());
|
||||
$fileFieldConfig->addComponent(new GridFieldDataColumns());
|
||||
$fileFieldConfig->addComponent(new GridFieldPaginator(5));
|
||||
$fileFieldConfig = GridFieldConfig::create()->addComponents(
|
||||
new GridFieldFilterHeader(),
|
||||
new GridFieldSortableHeader(),
|
||||
new GridFieldDataColumns(),
|
||||
new GridFieldPaginator(5),
|
||||
new GridFieldDeleteAction(),
|
||||
new GridFieldDetailForm()
|
||||
);
|
||||
$fileField = new GridField('Files', false, null, $fileFieldConfig);
|
||||
$fileField->setList($this->getFiles($parentID));
|
||||
$fileField->setAttribute('data-selectable', true);
|
||||
|
@ -91,12 +91,13 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
|
||||
}
|
||||
|
||||
$filterArguments = $state->Columns->toArray();
|
||||
$dataListClone = null;
|
||||
foreach($filterArguments as $columnName => $value ) {
|
||||
if($dataList->canFilterBy($columnName) && $value) {
|
||||
$dataList->filter($columnName.':PartialMatch', $value);
|
||||
$dataListClone = $dataList->filter($columnName.':PartialMatch', $value);
|
||||
}
|
||||
}
|
||||
return $dataList;
|
||||
return ($dataListClone) ? $dataListClone : $dataList;
|
||||
}
|
||||
|
||||
public function getHTMLFragments($gridField) {
|
||||
|
Loading…
Reference in New Issue
Block a user