ImportSourceHookTable: Apply modifiers when fetching data

This will make sure applying modifiers before initializing the
ArrayDatasource.

Before this change counting and pagination was broken with Black and
Whitelist.
This commit is contained in:
Markus Frosch 2019-04-09 16:47:17 +02:00 committed by Thomas Gelf
parent ad9b624e92
commit c5a79c6e88
1 changed files with 4 additions and 13 deletions

View File

@ -16,8 +16,6 @@ class ImportsourceHookTable extends SimpleQueryBasedTable
/** @var ImportSource */
protected $source;
protected $dataCache;
protected $columnCache;
protected $sourceHook;
@ -97,19 +95,12 @@ class ImportsourceHookTable extends SimpleQueryBasedTable
return $this->sourceHook;
}
public function fetchQueryRows()
{
if ($this->dataCache === null) {
$this->dataCache = parent::fetchQueryRows();
$this->source->applyModifiers($this->dataCache);
}
return $this->dataCache;
}
public function prepareQuery()
{
$ds = new ArrayDatasource($this->sourceHook()->fetchData());
$data = $this->sourceHook()->fetchData();
$this->source->applyModifiers($data);
$ds = new ArrayDatasource($data);
return $ds->select();
}
}