rero / sonar

SONAR - Swiss Open Access Repository
https://www.rero.ch/products/sonar
GNU Affero General Public License v3.0
12 stars 11 forks source link

Projects : CSV export customised for HEPVS not working as expected #933

Open mmo opened 1 year ago

mmo commented 1 year ago

Bug description:

Research projects have been customised for HEPVS, with the addition of several specific data fields that are not present in the standard version of research projects. When exporting HEPVS research projects to CSV ("Export as CSV" button), only standard fields are included in the CSV file.

This is a regression, as this feature was correctly implemented previously.

Expected behavior:

When exporting HEPVS research projects to CSV ("Export as CSV" button), all HEPVS custom data fields should be included in the CSV file.

Steps to Reproduce:

  1. Log in as admin for HEPVS
  2. Go to the "Research projects" page of the administration area
  3. Click on the "Export as CSV" button
  4. Open the downloaded CSV file, it should contain 30 data fields, but only 5 are present.
jma commented 1 year ago

The problem comes from some changes in flask-resources: https://github.com/inveniosoftware/flask-resources/blob/2f74ca86df50501742b949aa397ab6d4408224b3/flask_resources/content_negotiation.py#L97 the config is store in the context request at the application start. The solution can be to have only on config with a logic in the CSVSerializer depending on the current organisation. It can be usefull than this serializer can be usable also in a cli to export the projects in csv.