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

hook_civicrm_searchTasks get invoked twice for some entities

    Details

    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      When your extensions implemets hook_civicrm_searchTasks and in case you did a participant search page then in the result page, the action you added via this hook will appear twice in the actions box :

      This happens because the hook_civicrm_searchTasks hook get invoked twice for each extension when Search Participates result page get opened ..

      The reason why it does not happen at contact page is because the code that generate the menu items list will not call the hook if the menu items are already set , see :
      https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/Task.php#L253
      https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/Task.php#L80

      Unlike Event class which call the hook even if the tasks are already set :
      https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/Task.php#L70
      https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/Task.php#L150

      from looking into the code , these entities should suffer from the same issue but I didn't test that though :

      • Campaign
      • Case
      • Contribute
      • Grant
      • Member
      • Pledge

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              omarabuhussein omar abu hussein
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: