samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
185 stars 124 forks source link

Upload new version of file: problem processing request #6004

Open bbpennel opened 1 year ago

bbpennel commented 1 year ago

Descriptive summary

We are encountering a confusing behavior when attempting to upload new versions of files in hyrax 3

  1. Go to a work page
  2. In the "Items" table, click "Select an action" > Versions
  3. Click "Upload new version"
  4. Get error "There was a problem processing your request.", which comes from a POST request returning HTTP status 422

Apparently the "Upload new version" button is the submit button for a form and is active by default. The "Choose new file version" button above it is how you select what file to upload, but this was unclear to users and the application allows "Upload new version" to be clicked before the action is valid.

I was able to produce this behavior in nurax with hyrax 3.5 and 4.

Rationale

We've had multiple people (who are experienced hyrax users) at our institution very confused by this behavior

Expected behavior

Either hide or disable the "Upload new version" button until a file has been selected with the "Choose new file version" button.

Actual behavior

"Upload new version" button active before selecting a file, and gives an ambiguous error message.

rjkati commented 1 year ago

This was discussed at the 5/10/2023 Hyrax Interest Group call. The group would like to proceed with the suggestion to make the "Upload new version" button inactive until a file has been selected.

Additionally, we'd like to move the "Choose new file version" button so that it is between the "Upload New Version" header and the "Upload new version" button.

jlhardes commented 7 months ago

Verified that this is still possible/happening in Hyrax 5.0.0 using this work: https://dev.nurax.samvera.org/concern/images/ww72bb76t?locale=en