Skip to content

Commit 5f7705f

Browse files
tomonormanyaroslavmo
authored andcommitted
DP-388 Audit Debian Installer: Duplicate Entry on related records issue in Debian 9 fixed
1 parent 64b8072 commit 5f7705f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Resources/BaseDbTableResource.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,10 @@ protected function retrieveRelationRecords(TableSchema $schema, RelationSchema $
22462246
$extras['fields'] = $fields;
22472247
}
22482248
$relatedRecords = $this->retrieveVirtualRecords($refService, '_table/' . $refTable, $extras);
2249+
// For some bizarre reason, on Debian 9, duplicates of related tables are returned. (It returns the related table, multiplied by the
2250+
// total number of records, e.g 8 records, 8 duplicates.) In fear of breaking things elsewhere, the below will check and delete
2251+
// any duplicate entries and update. If there aren't any to begin with, then nothing will change.
2252+
$relatedRecords = array_unique($relatedRecords, SORT_REGULAR);
22492253

22502254
// Map the records back to data
22512255
if (!empty($relatedRecords)) {

0 commit comments

Comments
 (0)