TexasDigitalLibrary / Vireo

Vireo is a turnkey Electronic Thesis and Dissertation (ETD) Management System.
https://texasdigitallibrary.atlassian.net/wiki/spaces/VUG/pages/87490642/About
GNU General Public License v2.0
43 stars 33 forks source link

When renaming, file extension gets replaced with ".pdf" whether or not the file is a PDF #1941

Open labuchholz opened 1 month ago

labuchholz commented 1 month ago

Describe the bug When renaming files uploaded to a field with 'Manuscript in PDF' file type, the file extension also gets replaced, whether or not the file is a PDF. When the file is not a PDF, this causes confusion when admins download the file, try to open it in a PDF viewer, and get an error.

To Reproduce Steps to reproduce the behavior:

  1. As a submitter, upload a Word document into a field that has Input Type: 'INPUT_FILE' and Document Type: 'Manuscript in PDF'.
  2. The file gets renamed to lastname-primary-yyyy.pdf
  3. As an admin, download the file and open it in standard PDF viewer.

Expected behavior Rename only the base file name, leaving the extension as is. This would allow us to spot .doc files in List view, with the Manuscript in PDF column, and let us follow up with students. See https://github.com/TexasDigitalLibrary/Vireo/issues/1940 for ideal solution.

Additional context We do want the files to be renamed, so don't want to turn off the setting in application.yml

cstarcher commented 1 month ago

The default Manuscript in PDF field profile only allows pdf files to be uploaded. This only occurs when a second field profile with Manuscript in PDF and INPUT_FILE are selected. Currently, the system is only configured to use the default Manuscript in PDF field profile.

labuchholz commented 1 month ago

I think this bug report can be revised, then, to say that any field set in Manage Workflow with a "Manuscript in PDF" file type should not accept anything other than a PDF, or if it does, to not rename the extension.

We used a custom field in Manage Workflow for the 'upload your thesis as a pdf'; I don't remember why. So our system isn't using the default field profile.