Sync: Respect the fields used in filter_expression of the SyncRule

So that you can filter by fields not used in properties, or in property filters.

fixes #1130
refs #876
This commit is contained in:
Markus Frosch 2017-08-29 11:58:39 +02:00 committed by Thomas Gelf
parent 59eda8f9c4
commit e9546f68bf
2 changed files with 10 additions and 1 deletions

View File

@ -283,6 +283,12 @@ class Sync
$filterColumns[$column] = $column;
}
}
if (($ruleFilter = $this->rule->filter()) !== null) {
foreach ($ruleFilter->listFilteredColumns() as $column) {
$filterColumns[$column] = $column;
}
}
if (! empty($filterColumns)) {
foreach (SyncUtils::getRootVariables($filterColumns) as $column) {
$usedColumns[$column] = $column;

View File

@ -203,7 +203,10 @@ class SyncRule extends DbObject
return $this->sync;
}
protected function filter()
/**
* @return Filter
*/
public function filter()
{
if ($this->filter === null) {
$this->filter = Filter::fromQueryString($this->get('filter_expression'));