samvera-deprecated / sufia

[DEPRECATED] Sufia: a fully featured, flexible Samvera repository front-end.
http://sufia.io/
Other
111 stars 78 forks source link

Browse everything only attaches files on work create (not edit) #3167

Open hortongn opened 7 years ago

hortongn commented 7 years ago

Originally opened as https://github.com/projecthydra-labs/hyrax/issues/931

Descriptive summary

Attaching cloud files to a work behaves as expected when creating a brand new work. However, if an existing work is edited and the user attempts attach cloud-based files, and exception is thrown upon saving the work. Files are not attached.

We experienced the bug on 7.3.0

Expected behavior

The user should be able to attach cloud files either when creating a work or editing a work.

Actual behavior

Editing and saving an existing work with new cloud-based files attached throws an error.

Steps to reproduce the behavior

  1. Create a work
  2. Edit the work
  3. Add some new files from a cloud provider
  4. Save the work

Related work

University of Cincinnati has fixed this locally here: https://github.com/uclibs/scholar_uc/pull/1371/files

The fix is in the last line of the partial.

The problem is that when editing a work, browse_everything is looking for a form id of edit_generic_work. However the actual form id has the pid attached (e.g. edit_generic_work_h989r335q)