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#745 Further on_hold fix - it has been suggested the value might be an array like [''] #13773

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

This extends the fix to prevent us winding up with a query like on_hold IN ('') or on_hold IN (NULL)

Before

Potential inappropriate filtering on legacy smart groups

After

on_hold filter only applied for numeric values - either as a value or in an array

Technical Details

We seem to have some legacy group variants hitting problems - the data about what they might be is a bit unclear but this would see to ensure that only a non-empty array of numeric values gets to the if clause

Comments

@agileware-fj @seamuslee001 - Seamus felt we were missing some possible variants in #13754 so this should be tighter & still pretty sage

@civibot
Copy link

civibot bot commented Mar 6, 2019

(Standard links)

@civibot civibot bot added the 5.11 label Mar 6, 2019
@eileenmcnaughton eileenmcnaughton changed the title Further on_hold fix - it has been suggested the value might be an array like [''] dev/core#745 Further on_hold fix - it has been suggested the value might be an array like [''] Mar 6, 2019
@agileware-fj
Copy link
Contributor

@eileenmcnaughton @seamuslee001 In practice, I've not seen any sites where this was an empty string in an array.
That said, I think filtering out a cast array with is_numeric is more elegant.

FYI the on-the-wire fix I did the first time we came across this problem looked like:
$onHoldValue = array_map(function($v){ return (((int) $v) ?: 0); }, (array) $onHoldValue);

@seamuslee001
Copy link
Contributor

Merging as per the positive review by Francis and the fact tests are passing

@seamuslee001 seamuslee001 merged commit 58147be into civicrm:5.11 Mar 6, 2019
@eileenmcnaughton eileenmcnaughton deleted the 5.11- branch March 6, 2019 22:04
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