Sync: also fetch columns used in filters only
Filters might otherwise in some circumstances not work as expected fixes #876
This commit is contained in:
parent
e1760724b8
commit
f885d90a0a
|
@ -76,6 +76,7 @@ class Sync
|
|||
|
||||
protected $runStartTime;
|
||||
|
||||
/** @var Filter[] */
|
||||
protected $columnFilters = array();
|
||||
|
||||
/**
|
||||
|
@ -258,9 +259,20 @@ class Sync
|
|||
$key = $source->key_column;
|
||||
$this->sourceColumns[$sourceId][$key] = $key;
|
||||
$run = $source->fetchLastRun(true);
|
||||
$rows = $run->fetchRows(
|
||||
SyncUtils::getRootVariables($this->sourceColumns[$sourceId])
|
||||
);
|
||||
|
||||
$usedColumns = SyncUtils::getRootVariables($this->sourceColumns[$sourceId]);
|
||||
|
||||
$filterColumns = array();
|
||||
foreach ($this->columnFilters as $filter) {
|
||||
foreach ($filter->listFilteredColumns() as $column) {
|
||||
$filterColumns[$column] = $column;
|
||||
}
|
||||
}
|
||||
foreach (SyncUtils::getRootVariables($filterColumns) as $column) {
|
||||
$usedColumns[$column] = $column;
|
||||
}
|
||||
|
||||
$rows = $run->fetchRows($usedColumns);
|
||||
|
||||
$this->imported[$sourceId] = array();
|
||||
foreach ($rows as $row) {
|
||||
|
|
Loading…
Reference in New Issue