[MediaWiki-commits] [Gerrit] Only validate contributions on add/edit - change (wikimedia...crm)

2015-05-15 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Only validate contributions on add/edit
..


Only validate contributions on add/edit

Validations were running on delete and ruining everything.
Bug: T99288

Change-Id: Ic59be3431d621e5a979cff728ed74823303df3e0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Awight: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 63eb40f..4d5ca52 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -2055,6 +2055,10 @@
 
 switch ( $formName ) {
 case 'CRM_Contribute_Form_Contribution':
+   // Only run on add or update
+   if ( ! ( $form->_action & ( CRM_Core_Action::UPDATE | 
CRM_Core_Action::ADD ) ) ) {
+   break;
+   }
 // Source has to be of the form USD 15.25 so as not to gum up the 
works,
 // and the currency code on the front should be something we understand
 $source = $fields['source'];

-- 
To view, visit https://gerrit.wikimedia.org/r/211299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic59be3431d621e5a979cff728ed74823303df3e0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Only validate contributions on add/edit - change (wikimedia...crm)

2015-05-15 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/211299

Change subject: Only validate contributions on add/edit
..

Only validate contributions on add/edit

Validations were running on delete and ruining everything.
Bug: T99288

Change-Id: Ic59be3431d621e5a979cff728ed74823303df3e0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/99/211299/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 63eb40f..4d5ca52 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -2055,6 +2055,10 @@
 
 switch ( $formName ) {
 case 'CRM_Contribute_Form_Contribution':
+   // Only run on add or update
+   if ( ! ( $form->_action & ( CRM_Core_Action::UPDATE | 
CRM_Core_Action::ADD ) ) ) {
+   break;
+   }
 // Source has to be of the form USD 15.25 so as not to gum up the 
works,
 // and the currency code on the front should be something we understand
 $source = $fields['source'];

-- 
To view, visit https://gerrit.wikimedia.org/r/211299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic59be3431d621e5a979cff728ed74823303df3e0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits