Skip to content

Commit

Permalink
Fix common db relation insertion (#439)
Browse files Browse the repository at this point in the history
* Fix common db relation insertion

* Fix and update changelog

* Update CHANGELOG.md

Co-authored-by: Stanislas <[email protected]>

---------

Co-authored-by: Stanislas <[email protected]>
  • Loading branch information
Lainow and stonebuzz authored Dec 17, 2024
1 parent cbcbe68 commit 351321d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- Fix relation (`CommonDBRelation`) insertion
- Fix default entity insertion for a user
- Fixed `SQL` error when creating new injection model
- Fixed issue with missing dropdown options
Expand Down
2 changes: 1 addition & 1 deletion inc/commoninjectionlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ private function effectiveAddOrUpdate($injectionClass, $item, $values, $add = tr
//CommonDBRelation are managed separately, so related field should be ignored
// Ex : User -> groups_id -> Group_User
// groups_id should not be injected in User (field contains group name (string))
if ($option !== false && isset($option['displaytype']) && $option['displaytype'] == 'relation') {
if ($option !== false && isset($option['displaytype']) && $option['displaytype'] == 'relation' && !($item instanceof CommonDBRelation)) {
continue;
}

Expand Down

0 comments on commit 351321d

Please sign in to comment.