Exported CSV is empty when a filter is applied.

Created on 27 March 2019, over 5 years ago
Updated 10 November 2023, about 1 year ago

When I apply a filter to a view on the frontend and export a CSV from it, the file is empty. However on the view preview the results are appearing correctly.
For instance the following path results on a en empty CSV, but if I edit the view and set that filter value, the results are right on the view preview.
http://my.site.com/admin/content/export?some_field=176&_format=csv

πŸ› Bug report
Status

Active

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia nickgeorgiou

    I know this is old, but it's still appearing for me. I fixed the issue by changing the exposed filter widget (Selection type) from Autocomplete to Dropdown. This fixed the issue and the correct data was exporting for me as CSV and JSON. I tested this issue / solution for both CSV and JSON.

  • πŸ‡¨πŸ‡¦Canada francewhoa Sept-Îles, QuΓ©bec, πŸ‡¨πŸ‡¦

    We were able to reproduce this challenge using those steps

    Steps:

    1. Add an Autocomplete filter to your View.

    2. Using the View above, using the Autocomplete filter, search for keywords which includes those two bracket symbols [ and ]. For example, search for this [Keyword]

    3. Click on "Filter" button to display the result

    4. Results are all displayed

    5. Using views_data_export module, export to a CSV file

    6. Open the CSV file you created above

    7. The first line is included in the results. This is the header. But all the data is not included. In other words, the table header is included, but starting on line 2, all data is missing. This is the challenge. The needed end result is that all data is included in the CSV file. Not just the header.

    8. Redo all the steps above, except, remove the two bracket symbols from the filter. Now all data is included in the CSV file. So somehow, the two bracket symbols are related to this challenge.

    Using views_data_export 7.x-3.2 or more recent stable version

  • πŸ‡¬πŸ‡§United Kingdom drupalninja

    You can disable the access checks under the options Query Options in the view and that should allow you to download all results.

Production build 0.71.5 2024