Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to file is broken when the file name contains special characters #861

Open
pronguen opened this issue Jun 14, 2022 · 3 comments
Open
Labels
bug Breaks something but is not blocking client request f: data About data model, importation, transformation, exportation of data, specific for bibliographic data

Comments

@pronguen
Copy link
Contributor

pronguen commented Jun 14, 2022

Problem

Editing a document/file can break the link to a file if it contains certain characters.

How to reproduce

  • Add a file to a document with a filename with special characters: Ex:"TB_Gozübüyük_Jerad_2023.pdf"
  • See that the upload seems to work fine, the file can be seen in the public view
  • Edit and save the document or the file
  • See that the file with the special character cannot be opened anymore

Expected behaviour

Even if a file has special characters, editing or reindexing should not break the ability to access this file.

@pronguen pronguen added the bug Breaks something but is not blocking label Jun 14, 2022
@pronguen pronguen added f: public ui p-High To set a high priority! f: data About data model, importation, transformation, exportation of data, specific for bibliographic data labels Jul 12, 2022
@pronguen
Copy link
Contributor Author

pronguen commented Aug 8, 2022

Discussion during grooming:

  • Various options to solve the problem:
    1. Generate automatically a new numeric file name and store the submitted name in the header (need to override standard Invenio behaviour)
    2. Keep the submitted file name, but without all non-ASCII characters
    3. Check the validity of the file name, and ask the end user to change it if it is not valid

@jma
Copy link
Contributor

jma commented Dec 14, 2023

It seems that has been fixed by other packages. To fix existing:

doc = DocumentRecord.get_record_by_pid('xxx')
doc.sync_files(list(doc.files)[0])

@jma jma closed this as completed Dec 14, 2023
@github-project-automation github-project-automation bot moved this from In Development to Done in SONAR issues Dec 14, 2023
@PascalRepond PascalRepond reopened this Feb 26, 2024
@github-project-automation github-project-automation bot moved this from Done to Product Backlog in SONAR issues Feb 26, 2024
@PascalRepond
Copy link
Contributor

Reopening this issue with a better description of a way to consistently reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking client request f: data About data model, importation, transformation, exportation of data, specific for bibliographic data
Projects
Archived in project
Development

No branches or pull requests

4 participants