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

hook_civicrm_export is not called when exporting a custom search

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.29
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No
    • Overview:
      Hide
      hook_civicrm_export is not called when exporting custom search results. Since CRM-8140 was fixed, the problem only shows if you export the custom search fields, not if you make a field selection yourself.
      Show
      hook_civicrm_export is not called when exporting custom search results. Since CRM-8140 was fixed, the problem only shows if you export the custom search fields, not if you make a field selection yourself.
    • How it works currently:
      Hide
      E.g.:
      * Click 'search', 'custom searches'
      * Click 'basic search' (or any other custom search)
      * Click 'search'
      * Click 'Select records: All 203 records'
      * Click 'Actions', 'Export contacts'
      * (Click 'Export custom search fields', and 'Continue' if you are using CiviCRM 4.7.20 or later; this option is not available in earlier versions of CiviCRM.)
      * An export is created without calling hook_civicrm_export.
      Show
      E.g.: * Click 'search', 'custom searches' * Click 'basic search' (or any other custom search) * Click 'search' * Click 'Select records: All 203 records' * Click 'Actions', 'Export contacts' * (Click 'Export custom search fields', and 'Continue' if you are using CiviCRM 4.7.20 or later; this option is not available in earlier versions of CiviCRM.) * An export is created without calling hook_civicrm_export.
    • How it should work:
      Hide
      E.g.:
      * Click 'search', 'custom searches'
      * Click 'basic search' (or any other custom search)
      * Click 'search'
      * Click 'Select records: All 203 records'
      * Click 'Actions', 'Export contacts'
      * (Click 'Export custom search fields', and 'Continue' if you are using CiviCRM 4.7.20 or later; this option is not available in earlier versions of CiviCRM.)
      * An export is created after calling hook_civicrm_export.
      Show
      E.g.: * Click 'search', 'custom searches' * Click 'basic search' (or any other custom search) * Click 'search' * Click 'Select records: All 203 records' * Click 'Actions', 'Export contacts' * (Click 'Export custom search fields', and 'Continue' if you are using CiviCRM 4.7.20 or later; this option is not available in earlier versions of CiviCRM.) * An export is created after calling hook_civicrm_export.

      Description

      If you export the results of a custom search, and you choose to export the custom search fields, hook_civicrm_export is not called, which causes e.g. theĀ civiexportexcel-extension not to work for custom searches.

      I have a fix, which is a little hacky and not well tested. But I'll submit a pull request.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              johanv Johan Vervloet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: