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

Remove helper function now that contribution settings is not weirdly stored #16566

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CRM/Contribute/Page/UserDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function listContribution() {
'label' => ts('Pay Now'),
'url' => CRM_Utils_System::url('civicrm/contribute/transact', [
'reset' => 1,
'id' => CRM_Invoicing_Utils::getDefaultPaymentPage(),
'id' => Civi::settings()->get('default_invoice_page'),
'ccid' => $row['contribution_id'],
'cs' => $this->getUserChecksum(),
'cid' => $row['contact_id'],
Expand Down
18 changes: 0 additions & 18 deletions CRM/Invoicing/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,6 @@ public static function isInvoicingEnabled() {
return CRM_Utils_Array::value('invoicing', $invoiceSettings);
}

/**
* Function to call to determine default invoice page.
*
* Historically the invoicing was declared as a setting but actually
* set within contribution_invoice_settings (which stores multiple settings
* as an array in a non-standard way).
*
* We check both here. But will deprecate the latter in time.
*/
public static function getDefaultPaymentPage() {
$value = Civi::settings()->get('default_invoice_page');
if (is_numeric($value)) {
return $value;
}
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
return CRM_Utils_Array::value('default_invoice_page', $invoiceSettings);
}

/**
* Function to get the tax term.
*
Expand Down