Repository navigation
Conversation
Lainow
left a comment
There was a problem hiding this comment.
Asset types, models, and custom values in drop-down menus are shared across all definitions, and the kernel’s findID() function does not filter by definition (no getSystemSQLCriteria()). Thus, if two definitions both contain a type called “Server,” the injection into B binds the asset to the type from A, without this being flagged.
There was a problem hiding this comment.
To add to what @Lainow said
The cleanest fix would be in core: add + static::getSystemSQLCriteria() to the WHERE of CommonDropdown::findID() and CommonTreeDropdown::findID(). This also affects other imports, not only datainjection
We need a test that replicates this scenario.
ex: Definition A already has the type “Server,” the model “X42,” and the value “Blue” in its custom list. We inject these same names into definition B, then verify that the asset is linked to the items in B and not to those in A
|
This PR now depends on the core fix. Its CI will stay red until the core fix is merged on |
Lainow
left a comment
There was a problem hiding this comment.
The non-overwrite option is ignored for custom fields.
|
This fix will only be compatible starting with GLPI 12.0.2; this should be taken into account for the next release of the plugin |
8ff83e7
Checklist before requesting a review
Description
Supersedes #620.
Generic assets can now be imported with Data Injection. Every active asset definition appears in the list of types, if the user's profile is allowed to create that asset.
Supported fields:
Not supported: multiple-choice dropdowns and fields hidden for the user's profile.
All generic assets share the same database table, so an update only matches assets of the same definition.