Skip to content

Commit

Permalink
Sync: do not set null if overridden
Browse files Browse the repository at this point in the history
refs #2623
  • Loading branch information
Thomas-Gelf committed Oct 7, 2022
1 parent 20c3114 commit 0231001
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions library/Director/Import/Sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,22 +564,25 @@ protected function prepareNewObject($row, DbObject $object, $objectKey, $sourceI
);
} else {
if ($val === null) {
$this->setNull[$objectKey][] = $prop;
$this->setNull[$objectKey][$prop] = $prop;
} else {
unset($this->setNull[$objectKey][$prop]);
$object->vars()->$varName = $val;
}
}
} else {
if ($val === null) {
$this->setNull[$objectKey][] = $prop;
$this->setNull[$objectKey][$prop] = $prop;
} else {
unset($this->setNull[$objectKey][$prop]);
$object->set($prop, $val);
}
}
} else {
if ($val === null) {
$this->setNull[$objectKey][] = $prop;
$this->setNull[$objectKey][$prop] = $prop;
} else {
unset($this->setNull[$objectKey][$prop]);
$object->set($prop, $val);
}
}
Expand Down

0 comments on commit 0231001

Please sign in to comment.