Skip to content

Conversation

@PlaneNuts
Copy link
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

I encountered an issue when trying to import software licenses where most dropdown fields were attempting to inject the text value in the import file rather than the foreign ID from the corresponding table. This was traced back to there being missing dropdown IDs in softwarelicenseinjection.class.php, Adding the missing IDs fixed this for injecting software licenses, however, there was no way to know if there were missing items in other classes.

I saw these options in the injection class were being used to set the displaytype of dropdown, which is later used to determine if a foreign table relation needed to be made. Rather than adding these manually, I've made a change to set the displaytype of dropdown from the rawSearchOptions that are being stored in $tmp.

After making this change and reverting to the original array set in softwarelicenseinjection.class.php $options['displaytype'] = ["dropdown" => [5, 6, 7, 110], I confirmed that I could now successfully inject software licenses.

Screenshots (if appropriate):

image

@stonebuzz stonebuzz added the bug label Dec 16, 2024
@stonebuzz stonebuzz added this to the 2.14.1 milestone Dec 16, 2024
@stonebuzz stonebuzz self-requested a review December 16, 2024 15:54
@stonebuzz
Copy link
Contributor

Thank you for your contribution @PlaneNuts =)

@Rom1-B Rom1-B merged commit cbcbe68 into pluginsGLPI:main Dec 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with Relation fields in Software License Injection

3 participants