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

[Ref] Minor code extraction #18739

Merged
merged 1 commit into from
Oct 19, 2020
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Simple function extraction

Before

Long block of code

After

Extracted function

Technical Details

Much of the preceding code is doing stuff depending on the form calling it & should be moved back to the actual forms

Comments

@civibot
Copy link

civibot bot commented Oct 11, 2020

(Standard links)

@civibot civibot bot added the master label Oct 11, 2020
if (!is_array($options) || !in_array($id, $validPriceFieldIds)) {
continue;
}
elseif ($hideAdminValues && !in_array($className, $formClasses)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton I think this needs to be !$hideAdminValues because in the original code if the Perm check is true then hideAdminValues gets set to FALSE https://github.com/civicrm/civicrm-core/pull/18739/files#diff-9bb0aa4010a43713521df361cca72fe6L895 where was in your code it will be set to TRUE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @seamuslee001 - I've fixed to

$hideAdminValues = !CRM_Core_Permission::check('edit contributions');

@@ -0,0 +1 @@
<?php
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton looks like this snuck in by accident

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dang

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

Still there for me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

second time lucky..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seamuslee001 it has passed now

@demeritcowboy
Copy link
Contributor

This looks safe now. I'd say ok to merge.

@eileenmcnaughton
Copy link
Contributor Author

Merging based on @demeritcowboy review

@eileenmcnaughton eileenmcnaughton merged commit 413d1d8 into civicrm:master Oct 19, 2020
@eileenmcnaughton eileenmcnaughton deleted the ef branch March 18, 2021 11:30
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