-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
SearchKit - Fix campaign, event & primary address dropdowns #24963
Conversation
(Standard links)
|
6702425
to
aba2faf
Compare
Test this please |
aba2faf
to
044390a
Compare
That fixes the problem in https://lab.civicrm.org/dev/core/-/issues/3982 But ... in the dropdown for country, the additional information shown is the id. It would be more useful to show the ISO code field. |
044390a
to
e2f6270
Compare
…ists Before: option lists were preferred over FK After: FK is preferred over option lists Fixes dev/core#3950 Fixes dev/core#3982
e2f6270
to
7deb8c3
Compare
Thanks @aydun I've added a customized display for Countries with your suggestion. |
Thanks - Looks good. More generally, is it possible to search on multiple fields in an autocomplete? For example, can it be configured to search on both name and iso so that if I type in 'gb' it would find 'United Kingdom'? |
@aydun yes - these Autocompletes use a special type of SearchKit display that you can configure. The search logic currently treats all fields on the top line as searchable using OR. For performance reasons I didn't include other lines in the search so if you wanted to do this on a particular form you'd need to configure an autocomplete search display for that form and use "rewrite" to place both name and iso on the top line of the autocomplete results. |
Got it - thanks |
Overview
Fixes dev/core#3950 and dev/core#3982
Before
Multiple problems with SearchKit select lists
After
EntityRef to the rescue! 🦸
Technical Details
For fields with both an FK and an option list, prefer the FK because it's more efficient to render an autocomplete than to pre-load potentially thousands of options into a select dropdown. It also solves the bugs with Campaign lists (which has a funky set of no-prefecth options) and contact primary address dropdowns (which aren't strictly part of the contact entity so those options hadn't been loading).