-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
[REF] Afform - Code cleanup in LoadAdminData API action #21089
Conversation
(Standard links)
|
@colemanw looks simple - I can r-run if you confirm where I would see it |
@eileenmcnaughton if you add a search display that has 1 or more field transformation in the search, you should still see the transformed field in the afform when creating a form for the display. |
My transform isn't working - but it's pre-existing - ie 'amount' is not getting MATH options - trying another field |
@colemanw I was able to add & select a date field & transform to YEAR - the transform options for date field also seemed a bit confusing - ie but 'LOWER CASE still leaves the only cased thing in the date in upper case & I'm not sure what the MATH ones would mean in this context |
@colemanw so the summary is - I think that all the things I spotted testing this are unchanged by this & if you are happy that is the case then go ahead & merge |
Hoo boy, those are a lot of issues with the transforms. I think a lot of the issue is that not all sql functions are appropriate for every field and the UI needs to do a better job of making that clear. |
@colemanw I suspect once we can do them on combined fields the issues will change again so maybe it's worth figuring out that first |
Well there is a way to do pseudoconstants in SQL, by rewriting the query to use civicrm-core/Civi/Api4/Query/Api4SelectQuery.php Lines 318 to 327 in 1930b3e
I don't know how it would impact performance if we switched them ALL to work that way. We could switch the ones inside functions to do so though, and that would get things like UPPERCASE working. |
@colemanw I guess that's the question isn't it - should they all work in sql or should we do some parts in php. I guess that's why I think working on combining the fields makes sense - because whether you hit the limits of mysql in there might drive that answer |
Overview
Minor code simplification and added docblocks in the
loadAdminData
Afform API.