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

Upload file to published version (creating a draft) incorrectly allows same file name #6948

Closed
scolapasta opened this issue May 29, 2020 · 3 comments · Fixed by #7016
Closed
Milestone

Comments

@scolapasta
Copy link
Contributor

  1. Start from a published dataset (with files)
  2. Upload a file with the same name as an existing file.
    2a. (notice the name does not get auto changed)
  3. save.

The save succeeds, when it shouldn't, and you're left with a dataset with two files with the same path+name.

Expected behavior: file should be auto renamed when uploaded.

@scolapasta
Copy link
Contributor Author

Also can we have a db unique constraint on columns datasetversion_id, directorylabel, and label of the filemetadata table? That way db would never allow.

@scolapasta scolapasta changed the title Upload file to published version (creating a draft) doesn't restrict same file name Upload file to published version (creating a draft) allows same file name Jun 4, 2020
@scolapasta scolapasta changed the title Upload file to published version (creating a draft) allows same file name Upload file to published version (creating a draft) incorrectly allows same file name Jun 4, 2020
@djbrooke djbrooke added this to the Dataverse 5 milestone Jun 4, 2020
@sekmiller sekmiller moved this from Up Next 🛎 to IQSS Team - In Progress 💻 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Jun 22, 2020
@sekmiller sekmiller self-assigned this Jun 22, 2020
sekmiller added a commit that referenced this issue Jun 24, 2020
@sekmiller
Copy link
Contributor

If I run this query on my 3 month old copy of production data I find that there are about 350 dataset versions effected, some 311 Released, 25 in Draft and 18 Deaccessioned :

select versionstate, count() from datasetversion where id in
(select datasetversion_id from filemetadata
group by label, directorylabel, datasetversion_id
having count(
) > 1)
group by versionstate

@sekmiller
Copy link
Contributor

sekmiller commented Jun 24, 2020

Also some 1500 or so file metadata combinations are involved when querying only released versions. Over 200 have more than two name/directory/version duplicates. Bottom line: I don't think it's feasible to try to clean this up and add the constraint in Dataverse 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants