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

Replacing a file in an existing resource does not refresh the format #7415

Open
amercader opened this issue Feb 23, 2023 · 0 comments · May be fixed by #7466 or #8098
Open

Replacing a file in an existing resource does not refresh the format #7415

amercader opened this issue Feb 23, 2023 · 0 comments · May be fixed by #7466 or #8098

Comments

@amercader
Copy link
Member

CKAN version

2.0

Describe the bug

When replacing an existing uploaded or linked file in a resource with one with a different format, the format of the previous file is kept. Apart from the inconsistency this is a problem because it affects the views created for the resource, as most view plugins rely on the format to be available or not.

The resource name is also kept, and as this defaults to the file name it is confusing.

Steps to reproduce

  • Create a resource, upload a test.csv CSV file. The format of the created resource is CSV and the name "test.csv"
  • Edit this resource, clear the file and upload a PNG. The format and the name are still CSV and test.csv

Expected behavior

I'd expect the metadata to be updated to reflect the actual file being uploaded, ie correct format and name

Additional details

  • The format file has the if_empty_guess_format validator, which makes sense for new resources (if the user provided their own format, don't overwrite it). But with existing files is more complicated as we need to know if the user has changed the value of format.
  • I don't think anything on the schema about defaulting to the file name, so I assume this is done in javascript
amercader added a commit to frictionlessdata/ckanext-validation that referenced this issue Feb 23, 2023
@TomeCirun TomeCirun linked a pull request Mar 19, 2023 that will close this issue
5 tasks
@TomeCirun TomeCirun linked a pull request Mar 5, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant