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] Standardise methods of determining isTest #19417

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jan 18, 2021

Overview

[REF] Standardise methods of determining isTest

Before

A bit ad hoc

After

used a function

Technical Details

Comments

@civibot
Copy link

civibot bot commented Jan 18, 2021

(Standard links)

@civibot civibot bot added the master label Jan 18, 2021
@seamuslee001
Copy link
Contributor

@eileenmcnaughton so if someone was to load up the live back office new membership form but with &action=preview then at the moment would that be treated as test or not?

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 on the main flow it would be unchanged - for the obscure flow it would 'do what the main flow does' - which means these lines https://github.com/civicrm/civicrm-core/pull/19417/files#diff-e7ba7553d0e3638ecd45d305f95eabe0fec73ff33609a9cfb4cf0f148fb118e0L1954 (written for the front end pages) would not apply - which makes sense as we should not do something different for recurring than non recurring (which is the main flow) wrt is_test

@@ -1950,12 +1948,7 @@ protected function legacyProcessRecurringContribution(array $params, $contactID)
$recurParams['currency'] = $params['currency'] ?? NULL;
$recurParams['payment_instrument_id'] = $params['payment_instrument_id'];

$recurParams['is_test'] = 0;
if (($form->_action & CRM_Core_Action::PREVIEW) ||
(isset($form->_mode) && ($form->_mode == 'test'))
Copy link
Member

Choose a reason for hiding this comment

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

ensured removing $form->_action & CRM_Core_Action::PREVIEW doesn't affect the test mode processing on membership backoffice form.

@@ -1938,7 +1937,6 @@ protected function processContribution(
* @return int
*/
protected function legacyProcessRecurringContribution(array $params, $contactID): int {
$form = $this;
Copy link
Member

Choose a reason for hiding this comment

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

safely deleted, no reference to $form present.

@monishdeb
Copy link
Member

Did r-run on local, doesn't break scenario for test/live mode. Reviewed code, looks good to me.

@monishdeb monishdeb merged commit 995bab0 into civicrm:master Feb 2, 2021
@eileenmcnaughton eileenmcnaughton deleted the test branch February 3, 2021 00:29
@eileenmcnaughton
Copy link
Contributor Author

Thanks @monishdeb

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