Fixed #14114 - correctly sort related fields for labels #14162
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.
Previously, if you selected multiple assets that were sorted in your list view, the labels would crash if you were sorting on something that wasn't directly on the assets table (category, model, location, status label, etc) with the error of
since
assets.status_label
isn't a field, and we have to reach throughassets.status_id
->status_labels.id
to find out the name of the status label an asset has (and the same goes for company, category, etc). We already have those query scopes set up, since they're the same ones the API and listings pages use, so this implements them here as well.This fixes RB-17764 and sc-24511, and is related to #14114.