Skip to content

Commit

Permalink
Sync: create objects with original key...
Browse files Browse the repository at this point in the history
...and not with the lower-cased comparison key

fixes #2608
  • Loading branch information
Thomas-Gelf committed Sep 22, 2022
1 parent 0682ee5 commit 60bdef6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Director/Import/Sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,12 @@ protected function prepareNewObjects()

foreach ($this->sources as $source) {
$sourceId = $source->id;
$keyColumn = $source->get('key_column');

foreach ($this->imported[$sourceId] as $key => $row) {
// Workaround: $a["10"] = "val"; -> array_keys($a) = [(int) 10]
$key = (string) $key;
$originalKey = $row->$keyColumn;
if ($this->usedLowerCasedKeys) {
$key = strtolower($key);
}
Expand All @@ -497,7 +499,7 @@ protected function prepareNewObjects()
} else {
$props = [
'object_type' => 'object',
'object_name' => $key
'object_name' => $originalKey,
];
}

Expand Down

0 comments on commit 60bdef6

Please sign in to comment.