Skip to content

Commit 351321d

Browse files
Lainowstonebuzz
andauthored
Fix common db relation insertion (#439)
* Fix common db relation insertion * Fix and update changelog * Update CHANGELOG.md Co-authored-by: Stanislas <[email protected]> --------- Co-authored-by: Stanislas <[email protected]>
1 parent cbcbe68 commit 351321d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
### Fixed
1515

16+
- Fix relation (`CommonDBRelation`) insertion
1617
- Fix default entity insertion for a user
1718
- Fixed `SQL` error when creating new injection model
1819
- Fixed issue with missing dropdown options

inc/commoninjectionlib.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ private function effectiveAddOrUpdate($injectionClass, $item, $values, $add = tr
16451645
//CommonDBRelation are managed separately, so related field should be ignored
16461646
// Ex : User -> groups_id -> Group_User
16471647
// groups_id should not be injected in User (field contains group name (string))
1648-
if ($option !== false && isset($option['displaytype']) && $option['displaytype'] == 'relation') {
1648+
if ($option !== false && isset($option['displaytype']) && $option['displaytype'] == 'relation' && !($item instanceof CommonDBRelation)) {
16491649
continue;
16501650
}
16511651

0 commit comments

Comments
 (0)