Export of contacts when filtering on custom field exports all contacts in database
Overview
When I filter contacts from Advanced Search and select a custom field to filter on, in the next screen, the correct list and number of records comes up. From there if I select All [number of records] records and select Export contacts, the next screen also shows the correct number of contacts from the previous screen. But when I click 'continue' to export the records, the export contains all the records in the database. This does not happen when the list is filtered for non custom fields.
Reproduction steps
- Visit Advanced Search
- Select a custom field value as search criteria and click search
- See expected search results. Now click All Records and Export Contacts.
- On the next screen see that the expected number of contacts say they will be in the export. Click continue and all the contacts in the database are in the exported file.
Environment information
- CiviCRM: 5.62.1
- PHP: 8.0.29
- CMS: Drupal 9.5.9
- Database: MySQL 5.7.39