Export file empty when utilizing "Display results as" and searching for custom data
Overview
When exporting data after an advanced search the exported file is empty if:
- "Display results as" was set to "related contacts" AND
- one search criterium was a custom field
The export preview shows all information correctly but the exported file does not contain any data.
Reproduction steps
- Create a contact custom field (if you do not have one already, ex: Favorite Color: A/B/C)
- Perform an advanced search, set "Display results as" to "related contacts" and any relationship type (ex: 'Employee Of')
- Choose at least one custom filed as a search criterium (the search result must contain at least one contact (you may have to create/edit a test contact so that the Custom Field has a value)
- Export the contact(s) from the search result
Current behaviour
The export file is empty although the export's preview shows all information correctly (in case you choose data to export and not export primary fields). Note that the export will work as intended if you do not set "Display results as" to "related contacts" or do not have at least one search criterium was a custom field.
Expected behaviour
Export file should contain data of selected contacts
Environment information
- Browser: all
- CiviCRM: Master/5.35.x, probably also earlier versions
Comments
Possibly unrelated but referencing #2873 (closed) and assigning to @monish.deb as there is currently a fix for the export feature in progress.