Fix for Missing Dropdown Options #448
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist before requesting a review
Please delete options that are not relevant.
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
displaytypeof 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 thedisplaytypeofdropdownfrom 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.displaytypefrom the rawSearchOptions in adition to the options manually entered array of options in the injection classesScreenshots (if appropriate):