Fixed #17652 - don't break company drop-down with modals#18396
Merged
snipe merged 1 commit intogrokability:developfrom Jan 5, 2026
Merged
Fixed #17652 - don't break company drop-down with modals#18396snipe merged 1 commit intogrokability:developfrom
snipe merged 1 commit intogrokability:developfrom
Conversation
Member
Author
|
I've tested those modals and they do seem to continue to work, creating the appropriate things and assigning them to the new asset. |
Member
Author
|
Side note - I also checked this against Accessories, where I could also reproduce the bug (this time, with the new 'Location' modal). And this fix fixes that too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
So the Company-select partial that we use is used not only in Create Asset, but also in the modal, for when you create either a user for the asset to be checked-out to, or if you create a default location for it to be assigned-to.
So, to fix that, I just removed ID from the company select in the partials. That seems like a bit of a 'harsh' fix, but I couldn't find anywhere in the code where we actually used the ID of the company select for anything. So instead of writing some kind of weird stuff that would dynamically name the ID, with some kind of reasonable fallback - I just pulled it out completely.
Before this fix, opening up the 'create' modal for either creating a user or for creating a default location would break the company drop-down in the 'parent' form. After the fix, both use cases no longer break the company drop-down.
I made sure to confirm that the modals javascript that we use just does a default "form-serialize" (which is based on element
name, not based onid), so it should not be affected.Fixes #17652