-
Notifications
You must be signed in to change notification settings - Fork 96
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
SearchableDropdownField breaks grid field filtering #1733
Comments
I've made several attempts to work around these changes, but due to the variability of how data is stored, how we send data to the server and how it is displayed, this requires more careful study than simply fixing a tag display problem. Since, for example, in the current implementation of I will leave my PR open, but I think that |
@sabina-talipova Can you please give me some steps that I can follow to see and reproduce the problems you were running into? |
Yes, sure, @GuySartorelli
For multiple choice is better to test in Files section in file Permissions tab (Viewer Users). |
I've updated the steps to reproduce in the issue description - this isn't about searching for things by name like the original steps implied. It's specifically about searching using the Note that searching by name in the original instructions only doesn't work because the SilverStripe\Security\Group:
searchable_fields:
- 'Title'
- 'Description'
- 'ParentID' I'll look into the problems you were facing now that I understand the core issue. |
It's not quite correct conclusion. The problem is that we convert Object to String (it means Object.toString()) and get |
That's true from a technical perspective, yes. I was just trying to get the user perspective so I can actually reproduce the problem in the first place, which is what I now have. |
PR merged. This will be automatically tagged by GitHub actions. There's still some follow-up work to do, see #1746 for details. |
Module version(s) affected
2.2.2
Description
In Silverstripe Admin 2.2.0+ the new
SearchableDropdownField
breaks grid field filtering, if you select any option from the dropdown and click search[object Object]
is sent as the value and displayed in the filter tags. This appears to be caused by onChange receiving an object ({value: 1, label: "Option Label", selected: false }
for example) instead of a string/numeric value.This is exaggerated because
SearchableDropdownField
now appears to be the scaffold default for relationships.How to reproduce
ParentID
toSilverStripe\Security\Group
'ssearchable_fields
:Attempt to search for the defaultAdministrators
GroupNote the tag in the filter bar and the request made to the server has the same value/admin/security/groups
click the search magnifying glass, then click the "search options" dropdown.[object Object]
Possible Solution
A possible solution to this is to change the
handleChange
function to callonChange
likeSingleSelectField
does passing the actual value as the second argument.Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: