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

Fix another instance of silly use of CRM_Utils_Array::value #16712

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 9, 2020

Overview

Removes another place where a non array is sometimes passed to CRM_Utils_Array::value

Before

Values passed to include CRM_Utils_Array::value as the array include strings & integers

After

It the value is a string CRM_Utils_Array::value would return the default - of 0 - so !is_array($result) is equivalent to $result['is_error'] = 0. It could also be a getsingle result so the absence of is_error as a key also indicates success

Technical Details

Comments

@civibot
Copy link

civibot bot commented Mar 9, 2020

(Standard links)

@civibot civibot bot added the master label Mar 9, 2020
@seamuslee001
Copy link
Contributor

Tests have passed and if there was an issue i'm sure our chained api tests would have failed merging

@seamuslee001 seamuslee001 merged commit 02c7801 into civicrm:master Mar 9, 2020
@seamuslee001 seamuslee001 deleted the dep2 branch March 9, 2020 06:25
@colemanw
Copy link
Member

colemanw commented Mar 9, 2020

Err, well this change does capture the literal meaning of what CRM_Utils_Array::value does, but when you look at it this way it doesn't quite make sense. You can't perform api chaining without an array of results! See follow-up #16718

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