Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9562

Fire pre and post hooks for trash and restore of contacts

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.8
    • Fix Version/s: 4.1.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Problems:
      1. Currently no hook is fired when restoring a contact from trash.
      2. Also, the 'delete' operation is passed to pre and post hooks at two different times: when moving a contact to trash, AND when permanently deleting a trashed contact.

      Proposed solutions:
      1. This patch addresses item 1 by adding 'trash' and 'restore' operations for pre and post hooks.
      2. This doesn't attempt to address item 2; a more complete solution will be – I suggest – to stop firing the hooks with 'delete' operation when sending contact to trash, and only use that op when permanently deleting the contact; but this raises backwards-compatibility concerns, so I'm not trying to address it here. So with this patch, these hooks are still called with 'delete' op upon trashing a contact, but now they're also called with the 'trash' op at that time.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              allenshaw Allen Shaw
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: