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] start unravelling the way we retrieve the saved search #20953

Merged
merged 1 commit into from Jul 27, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 26, 2021

Overview

dev/core#2721 [REF] start unravelling the way we retrieve the saved search

Before

We want to get to the point of passing out a consistent $savedSearch array to the 3 sql functions - but it is already inconsistent when it is retrieved into this function

After

Retrieved consistently. Wrangling closer to where it is used (but still needs some sorting)

Technical Details

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

Comments

@civibot
Copy link

civibot bot commented Jul 26, 2021

(Standard links)

@civibot civibot bot added the master label Jul 26, 2021
}
else {
$fv = CRM_Contact_BAO_SavedSearch::getFormValues($savedSearchID);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact I will push this into the following sql functions as a follow up - but it needs to be combined with the line below

@eileenmcnaughton eileenmcnaughton changed the title [REF] start unravelling the way we retrieve the saved search dev/core#2721 [REF] start unravelling the way we retrieve the saved search Jul 26, 2021
@@ -796,7 +796,10 @@ private static function updateCacheFromTempTable(CRM_Utils_SQL_TempTable $groupC
*/
protected static function insertGroupContactsIntoTempTable(string $tempTableName, int $groupID, ?int $savedSearchID, ?string $children): void {
if ($savedSearchID) {
$ssParams = CRM_Contact_BAO_SavedSearch::getSearchParams($savedSearchID);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've basically copied getSearchParams into the appropriate parts of this function so we can start from a clean array

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants