Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404330 )

Change subject: Enforce limit on 1 with fishing net rule.
......................................................................

Enforce limit on 1 with fishing net rule.

The fishing net rule is more intensive that other rules so should only run on a
single contact.

On testing I was not hitting a large query using 'merge and go to listing' like
I thought I identified in the ticket so I think people may have been doing a 
merge
& winding up at the main dedupe screen & choosing the rule from there. I'll 
double check
with Leanne if there is another way to trigger a bad query. I think the 
exacerbating thing
here is that if the contact you start from is deleted (standard if they have 
the higher
id) then the redirect back to see other dedupe pairs doesn't find any & you 
wind up
on the main screen.

I think we need to add this hook to fix that flow
https://github.com/civicrm/civicrm-core/pull/11519

Bug: T182251
Change-Id: Idab71e3f11dfac1bab0d1de7ee9258bbdbbedb23
---
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/30/404330/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 67664cd..aaf6054 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -3967,6 +3967,10 @@
     if (!$fields['limit']) {
       $errors['limit'] = ts('Save the database. Use a limit');
     }
+    $ruleGroupID = $form->rgid;
+    if ($fields['limit'] > 1 && 'fishing_net' === civicrm_api3('RuleGroup', 
'getvalue', ['id' => $ruleGroupID, 'return' => 'name'])) {
+      $errors['limit'] = ts('The fishing net rule should only be applied to a 
single contact');
+    }
   }
   if ($formName == 'CRM_Contribute_Form_Contribution') {
     $engageErrors = wmf_civicrm_validate_contribution($fields, $form);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idab71e3f11dfac1bab0d1de7ee9258bbdbbedb23
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org>

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

Reply via email to