-
Notifications
You must be signed in to change notification settings - Fork 54
Fix common db relation insertion #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1606,7 +1606,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)) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about the fix, with this example (inject
The condition will return false (to delegate to specific case) -> OK But with this
The condition will return false -> KO Because
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the || operator, the plugin doesn't insert any data, whereas with &&, all data is actually inserted.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And I tested with a user like you said but everything works perfectly.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||||||
| continue; | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.