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

Support PropertyBag in CRM_Utils_Array #16699

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 6, 2020

Overview

We now use the PropertyBag in payment processors - but as @mattwire discovered the CRM_Utils_Array::value
function is commonly used to access values now potentially 'in the bag' and the 'is_array'
filtering here means it is not being returned

Before

Support PropertyBag in CRM_Utils_Array::value does not return values from the PropertyBag

After

Values returned - note we will encourage devs to move to direct access

Technical Details

Comments

discussion https://chat.civicrm.org/civicrm/pl/aygaho49jff5tqgar9erow7dew

@civibot
Copy link

civibot bot commented Mar 6, 2020

(Standard links)

@civibot civibot bot added the master label Mar 6, 2020
CRM/Utils/Array.php Outdated Show resolved Hide resolved
@eileenmcnaughton
Copy link
Contributor Author

Hmm - looks like Core_menu needs to case to an array

@colemanw
Copy link
Member

colemanw commented Mar 7, 2020

Retest this please

@colemanw
Copy link
Member

colemanw commented Mar 8, 2020

@eileenmcnaughton checking the console output, this appears to have triggered the deprecation notice 32 times.

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

test this please

1 similar comment
@eileenmcnaughton
Copy link
Contributor Author

test this please

We now use the PropertyBag in payment processors - but as @mattwire discovered the CRM_Utils_Array::value
function is commonly used to access values now potentially 'in the bag' and the 'is_array'
filtering here means it is not being returned
@eileenmcnaughton
Copy link
Contributor Author

@colemanw I've pulled out the attempt to deprecate passing in non-arrays. It became clear it wasn't just a few outliers that were doing that & it was getting into a silly scope situation

@colemanw colemanw merged commit 713525e into civicrm:master Mar 10, 2020
@colemanw colemanw deleted the array branch March 10, 2020 11:21
@artfulrobot
Copy link
Contributor

@colemanw @eileenmcnaughton Small follow-up PR #16737 so that array value still works on array access objects in the same way as it does for arrays.

colemanw added a commit that referenced this pull request Mar 10, 2020
…ollowup

CRM_Utils_Array::values follow up from #16699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants