-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: .map(Number) creates problems if preselect is not an id but a string #206
Conversation
…ring this is checking if filterGroups in fieldConfig contains 'relation' and only then maps to Number. This could still cause an issue, if a field contains ids and strings. I couldn't find a usecase for this, but something to think about. Another solution would be to cast the key in FilterGroupHelper->getGroupValuesForFilterGroup to string and we can remove the map function altogether. Function is only used in the pimcore_ecommerceframework_index_getvaluesforfilterfield route and therefor should not cause other problems
Hey @MercuryKojo thanks for the PR . Could you maybe also describe a way to reproduce it? |
Sure thing: add a FilterMultiSelect Precondition |
@MercuryKojo Thank you! I do get it now and it was introduced here #194. Your solution works fine, but maybe since it is 4 times the same code of getting the data out of the preselect, we could introduce a method for this and then just call the method inside of setValue? |
Alternatively I can do it too for you since I already would have it preprared. WDYT? |
would be apreciated |
Done! :) Could you confirm that this still works for you? |
sry for the late reply |
this checks if filterGroups in fieldConfig contains 'relation' and only maps to Number. This could still cause an issue if a field contains IDs and strings.
I couldn't find a use case for this, but something to think about. Another solution would be to cast the key in FilterGroupHelper->getGroupValuesForFilterGroup to string and we can remove the map function altogether. The function is only used in the pimcore_ecommerceframework_index_getvaluesforfilterfield route and therefore should not cause other problems