CRM-7308 Mark this pair as not a duplicate never completes in contact/merge

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.3.1
    • Fix Version/s: 3.3.3
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When looking at a pair of contacts to potentially merge on the page contact/merge one option presented is to "Mark this pair as not a duplicate."

      However when this is clicked, and after clicking "OK" to the pop-up dialog box, the page immediately starts reloading to a different page, typically dedupefind?reset=1&rgid=4&action=browse.

      Checking the dedupe_exception table, the new row never gets written.

      So two problems:

      1. It redirects to a VERY undesirable page (the list of potential duplicates sometimes takes 3-4 minutes to load)
      2. It doesn't save the exception

      I tried this on the demo site and could not replicate it.

      However I think the reason is that the demo site is speedy and has a very small database.

      On our production site, with a fairly large DB and slower response time, the ajax request goes out to write to dedupe_exception and before it can complete, the page redirects to the very slow-loading list of potential duplicates. The page redirect interrupts the ajax request and it never completes.

      I was able to fix the problem by introducing a delay before the page reload (Dedupe.tpl about line 42):

      if ( context == 'merge-contact' && reloadURL ) {
      //wait 4 seconds to allow the ajax to finish up before leaving the page
      function relocate ()

      {window.location.href = reloadURL;}

      setTimeout(function ()

      {relocate();}

      , 4000);

      }

      This is probably not the ideal solution--the 4 second delay may or may not be enough depending on circumstances. Ideally it would present you with a message saying the contacts had been marked as non-duplicates and then you would be allowed to go wherever you want.

      The return URL is set to {$userContextURL} (Merge.tpl around like 36). This usually seems to be dedupefind?reset=1&rgid=4&action=browse or some variant, regardless of the context.

      If it must redirect, something like /civicrm/contact/deduperules&reset=1 is a much better choice.

        Attachments

          Activity

          [CRM-7308] Mark this pair as not a duplicate never completes in contact/merge
          Donald A. Lobo added a comment -

          Brent:

          Any chance we can get a copy of your DB. We can encrypt it if needed

          Deepak Srivastava added a comment -

          Things should be better when we have caching implemented.

          For now the fix has been made to add a small delay and redirect to general "Find and Merge Duplicate Contacts" screen, as also suggested by Brent.

          Thanks Brent.

          Deepak Srivastava added a comment -

          Just realized there should also be some status message to indicate that the action really happened, which is not happening currently because ajax call not supporting it.

          Priya, could you take care of this.

          Ashwini Poharkar added a comment -

          Verified in r31690

            People

            • Assignee:
              Ashwini Poharkar
              Reporter:
              Brent Hugh

              Dates

              • Created:
                Updated:
                Resolved: