CRM-9119 AJAX.php static function deleteCustomValue( ) does not any hooks!

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.7
    • Fix Version/s: Unscheduled
    • Component/s: CiviCRM API
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      AJAX.php static function deleteCustomValue( ) does not any hooks!

      Under drupal when viewing tabbed custom data and deleting a group of custom data (When a group is multiple) hook_custom() does not get called.

      My expectation was that it would be called with "edit", and the object id.

        Attachments

          Activity

          [CRM-9119] AJAX.php static function deleteCustomValue( ) does not any hooks!
          Reinaart added a comment -

          Sorry about the title, that should be: AJAX.php static function deleteCustomValue( ) does not call any hooks!

          Marty Wright added a comment -

          I need to know the custom value field contents that have been deleted during hook processing, so I'm proposing an enhancement to the code added for this issue. I'll attach a patch that passes the deleted fields to the hook in same format used for the create/edit hook. It seems this could be useful to others.

          Marty Wright added a comment -

          Attached patch file.

          Donald A. Lobo added a comment -

          I'm not sure i like the idea of making an extra DB call for the possible use of the hook. On the other hand if we dont do it, the hook cannot recover the values? any other possibilities?

          lobo

          Donald A. Lobo added a comment -

          I'm not too keen on adding an extra DB call

          how about creatng a new op for the "custom" hook called "preDelete" and invoke this op before we do the actual delete?

          Coleman Watts added a comment -

          Custom delete hook does get called.

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Reinaart

              Dates

              • Created:
                Updated:
                Resolved: