Merge pull request #16577 from civicrm/5.23
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 17 Feb 2020 22:57:11 +0000 (11:57 +1300)
committerGitHub <noreply@github.com>
Mon, 17 Feb 2020 22:57:11 +0000 (11:57 +1300)
5.23 to master

1  2 
CRM/Dedupe/BAO/Rule.php
tests/phpunit/CRM/Dedupe/DedupeFinderTest.php

Simple merge
index 0e5f599a35c31a3a924771629e0e172565bc516f,71c56c315c39ac667fcfb42159d55c1256cd5bd2..6ba4c131bacc28e081df0951b0fe93e901708c7d
@@@ -117,10 -108,27 +114,29 @@@ class CRM_Dedupe_DedupeFinderTest exten
  
    }
  
+   /**
+    * Test that we do not get a fatal error when our rule group is a custom date field.
+    *
+    * @throws \CRM_Core_Exception
+    */
+   public function testCustomRuleCustomDateField() {
+     $ruleGroup = $this->createRuleGroup();
+     $this->createCustomGroupWithFieldOfType([], 'date');
+     $this->callAPISuccess('Rule', 'create', [
+       'dedupe_rule_group_id' => $ruleGroup['id'],
+       'rule_table' => $this->getCustomGroupTable(),
+       'rule_weight' => 4,
+       'rule_field' => $this->getCustomFieldColumnName('date'),
+     ]);
+     CRM_Dedupe_Finder::dupes($ruleGroup['id']);
+   }
    /**
     * Test a custom rule with a non-default field.
 +   *
 +   * @throws \CRM_Core_Exception
     */
    public function testCustomRuleWithAddress() {
      $this->setupForGroupDedupe();