Skip to content
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 option loading & rendering for in-place edit #25197

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

colemanw
Copy link
Member

Overview

Fixes dev/core#4037

Before

Can't edit-in-place select lists.
Console errors loading options.

After

Fixed.

@civibot
Copy link

civibot bot commented Dec 17, 2022

(Standard links)

@@ -144,7 +144,7 @@

if (!_.includes(['>', '<', '>=', '<='], ctrl.op)) {
// Only use option list if the field has a "name" suffix
if (field.options && field.suffixes && field.suffixes.includes('name')) {
if (field.options && (!field.suffixes || field.suffixes.includes('name'))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what conditions would !field.suffixes be true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the API call to getFields didn't include suffixes in the SELECT, then it would be missing. In that case I think we should assume do use the option list rather than don't, since most fields do support name.

@larssandergreen
Copy link
Contributor

Thanks! Tested and works.

@eileenmcnaughton
Copy link
Contributor

Merging based on @larssandergreen review

@eileenmcnaughton eileenmcnaughton merged commit 0b32f2c into civicrm:5.57 Dec 19, 2022
@eileenmcnaughton eileenmcnaughton deleted the fixOptions branch December 19, 2022 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants