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

dev/core#2721 [Ref] simplify passed parameters #20955

Merged
merged 3 commits into from
Jul 27, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 26, 2021

Overview

[Ref] simplify passed parameters

Builds on #20954 but narrows the functions down to receive groupID and savedSearch as an array

Before

sql being partly constructed in the calling function but given to the sql functions to compile

After

It's done in the sql functions

image

Technical Details

Even though this is arguably repetitive I think it makes more sense once we start thinking about offering some
some sort of hook or listener - ie it seems cleaner to specify the sql within the function than to pass some in

Comments

We have 3 types of saved searches
- search kit
- legacy core searches
- legacy custom searches

The only information these 3 need to load is the savedSearch details and
the group ID (to add in the add & exclude). The wrangling of the params should
happen in the getSql functions - which we can think about being in a listener once
they have standard inputs & outputs. However, to get to that point
we want to standardise those inputs & outputs. This removes
only point of randomness - ie savedSearch has a consistent value & the wrangling
of what is in it is pushed closer to the relevant functions
@civibot
Copy link

civibot bot commented Jul 26, 2021

(Standard links)

@civibot civibot bot added the master label Jul 26, 2021
I think if we want to make this some sort of hook or listener we don't really
want to pass out 'add select' and 'exclude clause' when they are just group id
with a bit of string. It seems cleaner to specify the sql within the function
@eileenmcnaughton eileenmcnaughton changed the title [Ref] simplify passed parameters dev/core#2721 [Ref] simplify passed parameters Jul 26, 2021
@seamuslee001
Copy link
Contributor

This works for me merging

@seamuslee001 seamuslee001 merged commit d38a96e into civicrm:master Jul 27, 2021
@seamuslee001 seamuslee001 deleted the sql3 branch July 27, 2021 02:12
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.

2 participants