Answers.Body: <p>I am not sure if its somehow related to one of the regression for 5.9.0 for Anonymous user ACL permission which is fixed in 5.9.1. Would be worth trying after upgrading CiviCRM to 5.9.1 or applying patch from <a href="https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13467.patch" rel="nofollow noreferrer">here</a>!</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-20T18:00:39.970Z
Answers.Text: Thank you! The 5.9.1 patch fixed this problem. Another proposed solution above about the different email addresses (billing/home) didn't apply.
Answers.UserDisplayName: Rachelle Niemela
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-17T13:06:29.477Z
Answers.LastActivityDate: 2019-01-17T13:06:29.477Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Am running CiviCRM 5.9.0 on WordPress 4.9.9, PHP 7.1.25.</p>
  
  <p>When I use a contribution page for memberships that worked before on another hosting provider and on a previous version of CiviCRM, the unsupervised reserved dedupe rule worked fine. Now, every time someone renews their membership online, I get a duplicate record. Not sure when this broke, when we moved over from our old hosting provider, when I updated CiviCRM, or if there's another reason why it doesn't work. I do know that it definitely worked late last year when we started getting some early renewals for 2019 and the system was on our old provider, running an older version of Civicrm and possibly an older version of PHP.</p>
  
  <p>If I manually run the rule, it brings up the duplicates and I can merge them. The merge screen shows that the email, first name and last name are exactly the same. In fact, if I enter the exact same contact information for all contact fields, it still doesn't dedupe.</p>
  
  <p>There is an error in the error_log, and not sure if this is the reason:
  [14-Jan-2019 14:00:52 America/Toronto] PHP Warning:  A non-numeric value encountered in /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php on line 900. This line is contained in a "// return if this is express mode" section.</p>
  
  <p>If I have to manually dedupe all of our online membership renewals, this will be a real pain, so any hints are greatly appreciated.</p>
  
  <p><a href="https://i.sstatic.net/4cieM.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4cieM.jpg" alt="dedupe rules"></a></p>
  
  <p><a href="https://i.sstatic.net/ntWQ9.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ntWQ9.jpg" alt="Unsupervised rule"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-14T21:18:20.637Z
Comments.Text: can you please attach screenshot of your unsupervised dedupe rule?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T02:41:45.460Z
Comments.Text: It's the default reserved one that comes with the install, so you can't see the contents. When you edit it, all you can do is change it from unsupervised to supervised or general. This did work before. I did try to replace it with my own that had the email with a weight of 1 and the first name with a weight of 1 with the total weight being 2. That didn't work either. So I deleted that test one and it's back to the default rule now.
Comments.UserDisplayName: Rachelle Niemela
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T03:23:07.090Z
Comments.Text: so you are taking about the equivalent of this https://dmaster.demo.civicrm.org/civicrm/contact/deduperules?action=update&id=4
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T22:14:02.677Z
Comments.Text: I am unable to log in or create an account to use this site. At the bottom of y question is the screen shot that shows all of the default dedupe rules that come with CiviCRM. In the Individual Rules section, the last entry is the Email (reserved) rule that is in place. In the second screen shot, you can see that because it's a reserved rule, you can't edit it or see what it does. Some of the research I've done about this default rule says that it checks email, first and last name, but I don't know if that's true. Nevertheless, it's the out of the box rule, so it should work.
Comments.UserDisplayName: Rachelle Niemela
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:33:27.647Z
Comments.Text: for demo site, fyi, the instructions are to just use demo / demo. my bad, i linked you to a page where you don't see that. if you go to home page ie https://dmaster.demo.civicrm.org then you see instructions
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:34:34.867Z
Comments.Text: I see no reason why the Email rule would be checking First and Last.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:38:07.100Z
Comments.Text: if this is a situation after a migration to another provider/server are you certain that everything else is working as expected?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:39:07.353Z
Comments.Text: "In fact, if I enter the exact same contact information for all contact fields, it still doesn't dedupe" - if you mean eg Add New Individual, then that won't be using the Unsupervised Rule - but perhaps you mean via the Contribution form?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:42:01.827Z
Comments.Text: Testing this on demo i get same Warning: messageWarning: A non-numeric value encountered in CRM_Contribute_Form_Contribution_Main::formRule() (line 900 of /srv/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php).
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:43:17.440Z
Comments.Text: but it did confirm that the contribution was added to the first existing contact with the email i used - demo@example.com (i had already created a duplicate via Add New Individual)
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:45:07.083Z
Comments.Text: my conclusion at this point is the Unsupervised rule on demo is working as expected despite that warning, ie if an email is entered which matches an existing record then the contribution is added to the existing record - no duplicate record is created. sorry that doesn't provide you a solution but it confirms that the expected behaviour is happening on latest civicrm - i haven't checked to see if there has been a regression that has already been fixed.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-15T23:45:49.650Z
Comments.Text: I just searched lab.civicrm for 'unsupervised' - no results - https://lab.civicrm.org/search?utf8=%E2%9C%93&search=unsupervised&group_id=59&project_id=&repository_ref=
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-16T22:48:35.483Z
Comments.Text: I've installed a test site that includes wordpress 5.0.3, a theme, and civicrm. And that's it. It does the same thing as my production website. It doesn't do deduping when submitting a membership through a very simple contribution pages. All my tests with the same email address (and first and last name) get a duplicate record. There's nothing in the ConfigandLog log file. Same non-numeric php error. So I'm stumped.
Comments.UserDisplayName: Rachelle Niemela
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-16T22:57:43.617Z
Comments.Text: Just checked the old hosting solution. It was running PHP 7.2 I'm running 7.1 on the new hosting solution - had to go down a version because of another issue I had with running civicrm here.
Comments.UserDisplayName: Rachelle Niemela
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-16T23:06:51.097Z
Comments.Text: Bumped it up to 7.2 and that didn't make a difference, so it doesn't look like it's a PHP issue.
Comments.UserDisplayName: Rachelle Niemela
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T14:32:40.420Z
Comments.Text: Is your membership/contribution form collecting an email other than billing?  At least on previous versions of Civi, we found that the duplicate rule didn't apply to/check billing email and so we were seeing a number of duplicate contacts because of that.
Comments.UserDisplayName: Lesley Carter - BackOffice
Tags: <duplicate-contacts>
Title: Unsupervised reserved rule for individuals not working
ThreadText: # Unsupervised reserved rule for individuals not working
  
  (Asked by: username_0 on 2019-01-14)
  
  Am running CiviCRM 5.9.0 on WordPress 4.9.9, PHP 7.1.25.
  
  When I use a contribution page for memberships that worked before on another hosting provider and on a previous version of CiviCRM, the unsupervised reserved dedupe rule worked fine. Now, every time someone renews their membership online, I get a duplicate record. Not sure when this broke, when we moved over from our old hosting provider, when I updated CiviCRM, or if there's another reason why it doesn't work. I do know that it definitely worked late last year when we started getting some early renewals for 2019 and the system was on our old provider, running an older version of Civicrm and possibly an older version of PHP.
  
  If I manually run the rule, it brings up the duplicates and I can merge them. The merge screen shows that the email, first name and last name are exactly the same. In fact, if I enter the exact same contact information for all contact fields, it still doesn't dedupe.
  
  There is an error in the error\_log, and not sure if this is the reason:
  [14-Jan-2019 14:00:52 America/Toronto] PHP Warning: A non-numeric value encountered in /home/xxx/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php on line 900. This line is contained in a "// return if this is express mode" section.
  
  If I have to manually dedupe all of our online membership renewals, this will be a real pain, so any hints are greatly appreciated.
  
  [![dedupe rules](https://i.sstatic.net/4cieM.jpg)](https://i.sstatic.net/4cieM.jpg)
  
  [![Unsupervised rule](https://i.sstatic.net/ntWQ9.jpg)](https://i.sstatic.net/ntWQ9.jpg)
  
  **Tags:** duplicate-contacts
  
  > **Comments:**
  > **username_1**: can you please attach screenshot of your unsupervised dedupe rule?  
  > **username_0**: It's the default reserved one that comes with the install, so you can't see the contents. When you edit it, all you can do is change it from unsupervised to supervised or general. This did work before. I did try to replace it with my own that had the email with a weight of 1 and the first name with a weight of 1 with the total weight being 2. That didn't work either. So I deleted that test one and it's back to the default rule now.  
  > **username_2**: so you are taking about the equivalent of this https://dmaster.demo.civicrm.org/civicrm/contact/deduperules?action=update&id=4  
  > **username_0**: I am unable to log in or create an account to use this site. At the bottom of y question is the screen shot that shows all of the default dedupe rules that come with CiviCRM. In the Individual Rules section, the last entry is the Email (reserved) rule that is in place. In the second screen shot, you can see that because it's a reserved rule, you can't edit it or see what it does. Some of the research I've done about this default rule says that it checks email, first and last name, but I don't know if that's true. Nevertheless, it's the out of the box rule, so it should work.  
  > **username_2**: for demo site, fyi, the instructions are to just use demo / demo. my bad, i linked you to a page where you don't see that. if you go to home page ie https://dmaster.demo.civicrm.org then you see instructions  
  > **username_2**: I see no reason why the Email rule would be checking First and Last.  
  > **username_2**: if this is a situation after a migration to another provider/server are you certain that everything else is working as expected?  
  > **username_2**: "In fact, if I enter the exact same contact information for all contact fields, it still doesn't dedupe" - if you mean eg Add New Individual, then that won't be using the Unsupervised Rule - but perhaps you mean via the Contribution form?  
  > **username_2**: Testing this on demo i get same Warning: messageWarning: A non-numeric value encountered in CRM_Contribute_Form_Contribution_Main::formRule() (line 900 of /srv/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php).  
  > **username_2**: but it did confirm that the contribution was added to the first existing contact with the email i used - demo@example.com (i had already created a duplicate via Add New Individual)  
  > **username_2**: my conclusion at this point is the Unsupervised rule on demo is working as expected despite that warning, ie if an email is entered which matches an existing record then the contribution is added to the existing record - no duplicate record is created. sorry that doesn't provide you a solution but it confirms that the expected behaviour is happening on latest civicrm - i haven't checked to see if there has been a regression that has already been fixed.  
  > **username_2**: I just searched lab.civicrm for 'unsupervised' - no results - https://lab.civicrm.org/search?utf8=%E2%9C%93&search=unsupervised&group_id=59&project_id=&repository_ref=  
  > **username_0**: I've installed a test site that includes wordpress 5.0.3, a theme, and civicrm. And that's it. It does the same thing as my production website. It doesn't do deduping when submitting a membership through a very simple contribution pages. All my tests with the same email address (and first and last name) get a duplicate record. There's nothing in the ConfigandLog log file. Same non-numeric php error. So I'm stumped.  
  > **username_0**: Just checked the old hosting solution. It was running PHP 7.2 I'm running 7.1 on the new hosting solution - had to go down a version because of another issue I had with running civicrm here.  
  > **username_0**: Bumped it up to 7.2 and that didn't make a difference, so it doesn't look like it's a PHP issue.  
  > **username_3**: Is your membership/contribution form collecting an email other than billing?  At least on previous versions of Civi, we found that the duplicate rule didn't apply to/check billing email and so we were seeing a number of duplicate contacts because of that.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-17. Score: 2 | Accepted answer
  
  I am not sure if its somehow related to one of the regression for 5.9.0 for Anonymous user ACL permission which is fixed in 5.9.1. Would be worth trying after upgrading CiviCRM to 5.9.1 or applying patch from [here](https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13467.patch)!
  
  HTH
  
  Pradeep
  
  > **Comments:**
  > **username_0**: Thank you! The 5.9.1 patch fixed this problem. Another proposed solution above about the different email addresses (billing/home) didn't apply.  
  
  ---
  
  