[5.x] Only get store-specific values for options#1220
Merged
Conversation
indykoning
previously approved these changes
Mar 6, 2026
Member
|
The order changed in the specs table, that's correct? |
c406f6a to
1e8bc17
Compare
Collaborator
Author
Looks like the ordering by |
Member
|
Seems like the order is still incorrect, follow-up: RAP-1858 |
31fcf9d to
7cc013e
Compare
Collaborator
Author
|
I've fixed the ordering (it was inconsistent between mysql versions) but the playwright test is having some issues. Will rerun those tests later. |
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.
ref: RAP-1828
This is a pretty dumb hack.
I initially added a GROUP BY on the store_id, which splits the resulting rows nicely in SQL. However, I noticed that Laravel internally always grabs just the last row that matches the primary key. This meant that I couldn't manually filter these results.
So here I just add a simple sort to make sure the
store_idI want is always last in the list, followed by the fallback. Initially I was going to sort it usingorderByRaw("FIELD(eav_attribute_option_value.store_id,0,{$currentstore_id})")to push the other store values down, but instead I ended up just filtering the other store values out first and then sorting for simplicity.