hyrax icon indicating copy to clipboard operation
hyrax copied to clipboard

Editing batch of works generates "NoMethodError in Hyrax::BatchEditsController#edit" error

Open jlhardes opened this issue 2 years ago • 1 comments

Descriptive summary

On nurax-pg, editing a batch of works displays a "NoMethodError in Hyrax::BatchEditsController#edit" error

Expected behavior

Selecting multiple works on the Works page and clicking "Edit Selected" should bring me to an edit page

Actual behavior

Selecting multiple works on the Works page and clicking "Edit Selected" generates an error message:

Screen Shot 2022-08-12 at 10 54 55 AM

Steps to reproduce the behavior

  1. On nurax-pg, navigate to Dashboard -> Works
  2. Select one or more works on the Works page
  3. Click the "Edit Selected" button
  4. Observe error message

Related work

#5461 Issue with initial report of batch work edit problem but error message was different

jlhardes avatar Aug 12 '22 14:08 jlhardes

#4913 BatchEditsController needs to support valkyrie objects - code changes identified here might be part of the work that needs to happen to address this issue

jlhardes avatar Aug 23 '22 17:08 jlhardes

Still seeing error message when selecting multiple works and trying to "Edit Selected" when testing locally on koppie.

jlhardes avatar Jan 23 '23 19:01 jlhardes

@rjkati This now works on Hyrax Version: 4.0.0.rc3, but it fails with Koppie v4.0.0.rc3

Hyrax:

HyraxEdit

Koppie:

batchEdit

gamontoya avatar May 23 '23 20:05 gamontoya

I've created 2 GenericWork's on the koppie app and in the Hyrax app. trying to batch edit on Koppie showed me that the form thought it was editing at least one Monograph work. I don't have any Monograph works in my local apps. I also noticed that when I accessed the rails console for koppie, it couldn't return a count for GenericWorks, but it could for Hyrax.

# KOPPIE
[3] pry(main)> GenericWork.all.count
NoMethodError: undefined method `all' for GenericWork:Class
from (pry):3:in `__pry__'

# HYRAX
[2] pry(main)> GenericWork.all.count
=> 2

Screenshot 2023-05-25 at 4 18 47 PM

alishaevn avatar May 26 '23 14:05 alishaevn

the dassie GenericWork and koppie GenericWork models are defined differently. The dassie Monograph and koppie Monograph models are defined the same however. to try and make sure things were as similar as possible between the two, I tried to make a monograph work in both apps, but the form for both failed with the error below.

image

alishaevn avatar May 26 '23 15:05 alishaevn

I merged main into the valykyrie_batch_edit branch and the batch edit works in koppie. (the branch with the combined code is valykyrie_batch_edit_update)

Screenshot 2023-05-31 at 3 01 44 PM

alishaevn avatar May 31 '23 20:05 alishaevn

@dlpierce please refer to the comment above. the koppie app is working, but the hyrax app is not. is that your expectation? or do you have other work from this branch that hasn't been pushed?

image

alishaevn avatar May 31 '23 21:05 alishaevn

tried this again today and the batch edit is working in hyrax and koppie. 🤷🏾‍♀️ 🎉 I left screen recordings on #5864.

the spec pipelines, like several of the others, are still failing though. 😞

alishaevn avatar Jun 05 '23 17:06 alishaevn

the spec pipelines are still failing and I believe they're legitimate. I time boxed trying to solve this and I'm putting this down.

alishaevn avatar Jun 26 '23 19:06 alishaevn