I'm working on a Drupal 9 website displaying custom table data and I need to provide CSV/XLS export links for it.
I've defined a view consuming the custom table data thanks to the Views Custom Table module. I've installed the Views Data Export module and configured a display to export data as CSV. This display is attached to the base display.
The CSV button is shown on the view, and when I'm logged in as admin, everything works fine. When I'm just an authenticated user, and I click on the button, the display attached to the CSV export is rendered and exported in CSV (so there is all the HTML in the file).

I think it is a permission issue: Export uses REST core module and this one is performing permission check on the entity (for example, user is able to access the entity). In my view, there is no entity because data comes from the View Custom Table module.

I'm not sure if there is a simple solution to find what is going wrong ?
Many thanks !

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aurel60 created an issue. See original summary.

jahanaraS’s picture

I am facing a similar issue where the authenticated user is not able to download the CSV for commerce order details. Where as, while login as Admin same URL works to download the CSV file

Any lead?

uberengineer’s picture

We have experienced the same issue and have determined that Drupal configuration exports the $store_in_public_file_directory value as an integer however the export file is checked as a Boolean
Patch checks the value against the boolean cast and correctly sets the public file directory and not private