Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch edit of works throws an error #316

Closed
kerchner opened this issue Feb 8, 2022 · 1 comment · Fixed by #543
Closed

Batch edit of works throws an error #316

kerchner opened this issue Feb 8, 2022 · 1 comment · Fixed by #543
Labels

Comments

@kerchner
Copy link
Member

kerchner commented Feb 8, 2022

Attempting to batch-edit multiple works
image
throws an error:

D, [2022-02-08T11:22:49.409966 #6778] DEBUG -- : [f547c42a-18ec-4fc3-b3b6-db05d84d34fc]   Load LDP (9.4ms) http://gwfedora-test2.wrlc.org:8080/fcrepo/rest/prod/gq/67/js/06/gq67js06p Service: 507340
I, [2022-02-08T11:22:49.428226 #6778]  INFO -- : [f547c42a-18ec-4fc3-b3b6-db05d84d34fc] Completed 500 Internal Server Error in 46ms (ActiveRecord: 1.4ms)
F, [2022-02-08T11:22:49.428781 #6778] FATAL -- : [f547c42a-18ec-4fc3-b3b6-db05d84d34fc]   
F, [2022-02-08T11:22:49.428819 #6778] FATAL -- : [f547c42a-18ec-4fc3-b3b6-db05d84d34fc] ArgumentError (Unknown attribute volume):
F, [2022-02-08T11:22:49.428888 #6778] FATAL -- : [f547c42a-18ec-4fc3-b3b6-db05d84d34fc]   
F, [2022-02-08T11:22:49.428953 #6778] FATAL -- : [f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:49:in `block (2 levels) in initialize_combined_fields'
[f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:47:in `each'
[f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:47:in `block in initialize_combined_fields'
[f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:45:in `each'
[f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:45:in `each_with_object'
[f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:45:in `initialize_combined_fields'
[f547c42a-18ec-4fc3-b3b6-db05d84d34fc] app/forms/batch_edit_form.rb:21:in `initialize'

Note that batch_edit_form.rb contains fields/attributes that are not present on all Work types; this could be the source of the problem.

@kerchner kerchner added the bug label Feb 8, 2022
@dolsysmith
Copy link
Contributor

Wondering how we want to handle a situation where someone might select works of different types to edit at once. The code as written creates a union of the fields available in the works in the batch. We could exclude fields that are not present in all the works (the simpler route), or we could try to prevent users from editing batches with different types of works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants