Skip to content

Commit

Permalink
Minor code cleanup to contribution pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jan 31, 2021
1 parent 3028852 commit 2af978f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CRM/Contribute/Form/Contribution/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public function buildQuickForm() {
// If we configured price set for contribution page
// we are not allow membership signup as well as any
// other contribution amount field, CRM-5095
if (isset($this->_priceSetId) && $this->_priceSetId) {
if (!empty($this->_priceSetId)) {
$this->add('hidden', 'priceSetId', $this->_priceSetId);
// build price set form.
$this->set('priceSetId', $this->_priceSetId);
Expand Down
9 changes: 9 additions & 0 deletions CRM/Contribute/Form/ContributionBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
*/
public $paymentInstrumentID;

/**
* The contribution ID
*
* @var int
*
* @fixme this is retrieved as a URL param. I think it is only set when using the contribution page in "invoice" mode
*/
protected $_ccid;

/**
* Is the price set quick config.
* @return bool
Expand Down
6 changes: 3 additions & 3 deletions CRM/Price/BAO/PriceSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -843,9 +843,9 @@ public static function buildPriceSet(&$form) {
// Mark which field should have the auto-renew checkbox, if any. CRM-18305
if (!empty($form->_membershipTypeValues) && is_array($form->_membershipTypeValues)) {
$autoRenewMembershipTypes = [];
foreach ($form->_membershipTypeValues as $membershiptTypeValue) {
if ($membershiptTypeValue['auto_renew']) {
$autoRenewMembershipTypes[] = $membershiptTypeValue['id'];
foreach ($form->_membershipTypeValues as $membershipTypeValue) {
if ($membershipTypeValue['auto_renew']) {
$autoRenewMembershipTypes[] = $membershipTypeValue['id'];
}
}
foreach ($form->_priceSet['fields'] as $field) {
Expand Down

0 comments on commit 2af978f

Please sign in to comment.