MESH-Research / knowledge-commons-works

The next-generation research repository for the Knowledge Commons (formerly Humanities Commons)
https://hcommons.org
MIT License
4 stars 0 forks source link

Works with .doc / .docx attachments crash viewer / cannot be downloaded #588

Closed mikethicke closed 1 week ago

mikethicke commented 1 month ago

Describe the bug

CORE deposits with docx or doc attachments failed to migrate. (Or I have been unable to find examples of successful migration.)

To Reproduce

  1. SSH to kcworks-prod
  2. Connect to the UI container: docker exec -it 4028a614fad1 /bin/bash
  3. cd /opt/invenio/var/import_data/import_files
  4. ls *.doc / ls *.docx Eg. o_1a40ns08si5p1buq1koc1eai1rb67.doc.applied_blake_miltons_response_to_empire.doc
  5. Find corresponding CORE deposit (usually by intuiting deposit title from filename) Eg. Applied Blake: Milton's Response to Empire
  6. Search for deposit on Works. Eg. https://works.hcommons.org/records/eak7n-gxp03
  7. Click on deposit
  8. Viewer does not appear
  9. Click on Download
  10. Goes to: https://works.hcommons.org/records/undefined/undefined?download=1

Example .docx : https://hcommons.org/deposits/item/mla:103/ / https://works.hcommons.org/records/ewxqw-1hm19

Deposits that seem not to have migrated at all:

Expected behavior

The work would be viewable and downloadable

monotasker commented 2 weeks ago

The files have migrated properly and can be downloaded directly with api calls. The issue is that the links on the detail page are wrong. This is happening somewhere in the UI data handling, since the 'link' values coming from the back end are correct.

monotasker commented 1 week ago

Fixed generated download links for files that don't have a supported previewer (including docx, doc, etc.)