Error when trying to replace a file through web interface
What steps does it take to reproduce the issue?
- Replace a .txt file via the browser
- Drag-n-drop or select the new file to replace the old file.
-
When does this issue occur? When trying to replace a file through the Dataverse web interface. Tested on various file formats (text, pdf, picture)
-
Which page(s) does it occurs on? dataset.xhtml, editdatafiles.xhtml
-
What happens? An error is shown "You cannot add Tabular Data Tags to a non-tabular file" and file replacement is stopped
-
To whom does it occur (all users, curators, superusers)? all users (tested with superuser, researcher, admin)
-
What did you expect to happen? The file should be replaced successfully
Which version of Dataverse are you using? v6.8
Any related open or closed issues to this bug report? Maybe #11972 (wild guess due to the error message mentioning tags)
Screenshots:
Are you thinking about creating a pull request for this issue? We are looking into it but haven't identified nor fixed the problem
@bjosel thanks for the bug report. Are you able to reproduce the bug on https://demo.dataverse.org ?
Hi @pdurbin, yes I can reproduce on demo.dataverse.org. See screenshot
@bjosel d'oh! Thanks for testing! Can you please also try it in the new UI at https://beta.dataverse.org/spa/ ?
@pdurbin On the new UI there was no error. Seems to work properly
@bjosel ok, thanks so much for testing. I'm glad there's no issue in the new UI.
I'm guessing it's this commit which removed replacing an empty list with null. https://github.com/IQSS/dataverse/commit/9baf2d52f48b875e8691e4b8325289049ac11080#diff-80df39df6cfebe2044116b34839cce6c0a72c1b58a0c7e245cd2f4056b91509fL515 . That causes and error because this statement then fails to return: https://github.com/IQSS/dataverse/blob/b78060aac62d8d40cb897bbf8a35b1c97a6e5ef7/src/main/java/edu/harvard/iq/dataverse/datasetutility/OptionalFileParams.java#L614 due to https://github.com/IQSS/dataverse/blob/b78060aac62d8d40cb897bbf8a35b1c97a6e5ef7/src/main/java/edu/harvard/iq/dataverse/datasetutility/OptionalFileParams.java#L201-L203 checking for null and not empty() .
@qqmyers hmm. From #11439. That would mean the bug was introduced in Dataverse 6.8.