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 check for financial acls to look for setting rather than sub-key of non-standard civicontribute_settings' setting #13150

Merged
merged 1 commit into from
Nov 24, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fixes an intra-rc regression where setting for financial acl was not being picked up

Before

Newly enabled financial acls ignored

After

Acls picked up

Technical Details

Some true awfulness was introduced in contribution settings a while ago. Some settings were declared as settings and settable via the api - but only worked when saved to 'the wrong place' via the preferences form munging them into a non-standard setting key. This now picks up either place.

As @mattwire commented - perhaps we would be better to update all the saved settings on upgrade....

Comments

@monishdeb can you test this with your financial acls stuff - I picked it up trying out something on them

@civibot
Copy link

civibot bot commented Nov 22, 2018

(Standard links)

@civibot civibot bot added the 5.8 label Nov 22, 2018
…of non-standard civicontribute_settings' setting
@seamuslee001
Copy link
Contributor

@eileenmcnaughton if @monishdeb isn't able to test what would you propose would be the way forward with this one

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 I'm pretty confident - it's similar to what we did with other half-mangled settings for the rc & I've checked locally

$contributeSettings = Civi::settings()->get('contribution_invoice_settings');
if (CRM_Utils_Array::value('acl_financial_type', $contributeSettings)) {
\Civi::$statics[__CLASS__]['is_acl_enabled'] = TRUE;
}
Copy link
Member

@monishdeb monishdeb Nov 23, 2018

Choose a reason for hiding this comment

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

umm

\Civi::$statics[__CLASS__]['is_acl_enabled'] = Civi::settings()->get('acl_financial_type') ?: CRM_Utils_Array::value('acl_financial_type', Civi::settings()->get('contribution_invoice_settings'), FALSE);

?

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 guess so but I kinda wanted to parse out the bit that should be deprecated / removed

@monishdeb
Copy link
Member

Sorry for the delay, agree with the patch BUT how about that one-liner?

@eileenmcnaughton
Copy link
Contributor Author

@monishdeb re the one-liner - I actually want to deprecate that handling for the 'not really set' & leaving it as an add on makes it easier to strip out.

I'm going to go ahead & merge this since you agree in principle & I want regressions in the rc fixed asap - We can tweak further in master but as @mattwire suggested actually transforming the settings makes sense

@eileenmcnaughton eileenmcnaughton merged commit 8689329 into civicrm:5.8 Nov 24, 2018
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