sul-dlss / happy-heron

Self-Deposit for the Stanford Digital Repository (SDR): H2 is a Rails web application enabling users to deposit scholarly content into SDR
Apache License 2.0
10 stars 2 forks source link

Setting work type for a PURL reservation fails from the work show page #3572

Open peetucket opened 4 days ago

peetucket commented 4 days ago

Once you reserve a PURL, you need to set the work type to edit the work. There is a modal that shows in this situation before you get to the work page. In fixing this issue: https://github.com/sul-dlss/happy-heron/issues/3570 (users potentially going directly to the edit work URL), we discovered that setting the work type from the work show page doesn't work, even though it works from the dashboard or the collection list page.

To reproduce:

  1. Reserve a PURL within a given collection.
  2. Visit the work detail page for your reserved PURL.
  3. Click the pencil icon next to the title - you should get the work type modal.
  4. Select a work type and click submit. It will set the work type but you will get a blank page with a "Content missing" error.
  5. Refresh the page and you are back on the Work detail page, and now you can edit it as normal.

If you follow the same process, but click the pencil icon for the reserved PURL on the dashboard, you will see it correctly redirects to the edit page after setting the work type.

Suspect something not working correctly in turbo.

This PR adds some test expectations in https://github.com/sul-dlss/happy-heron/blob/main/spec/features/purl_reservation_spec.rb to verify the error: https://github.com/sul-dlss/happy-heron/pull/3571/files Uncomment them out when this is fixed