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

Something Went Wrong when adding an existing or new work as a child work #2108

Closed
vantuyls opened this Issue Nov 3, 2017 · 7 comments

Comments

Projects
6 participants
@vantuyls
Contributor

vantuyls commented Nov 3, 2017

Descriptive summary

when adding a child work to a work, we receive Something Went Wrong error page upon submit.

Expected behavior

child work should be added to the work without error.

Actual behavior

when adding a child work to a parent work and saving, Something Went Wrong.

Steps to reproduce the behavior

  1. Create two works (or have existing two works) in Hyrax rc2
  2. Go to one of the works and select the Edit button
  3. Navigate to the Relationships tab
  4. Attach child work:
    4.1a - attach an existing work by searching for it in the relationships window and selecting add
    4.1b - select save for the parent work
    4.1c - Something Went Wrong
    4.2a - attach a new work by selecting "attach new work" button
    4.2b - create the new work and save
    4.2c - Something Went Wrong

@mjgiarlo @julesies

@vantuyls vantuyls added the blocker label Nov 3, 2017

@vantuyls vantuyls added this to the 2.0.0 milestone Nov 3, 2017

@mjgiarlo mjgiarlo added bug ready labels Nov 3, 2017

@mjgiarlo

This comment has been minimized.

Member

mjgiarlo commented Nov 3, 2017

Here is the traceback:

F, [2017-11-03T20:39:20.039778 #29112] FATAL -- : [03388237-b6ae-4a81-b587-558d963edddc] ArgumentError (You attempted to set the property `state' of 1r66j118d to an enumerable value. However, this property is declared as singular.):
F, [2017-11-03T20:39:20.039977 #29112] FATAL -- : [03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/attributes/property_builder.rb:49:in `state='
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:325:in `block (3 levels) in merge_target_lists'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:324:in `each'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:324:in `block (2 levels) in merge_target_lists'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:320:in `tap'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:320:in `block in merge_target_lists'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:317:in `map'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:317:in `merge_target_lists'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:242:in `load_target'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:135:in `to_ary'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_association.rb:286:in `select'
[03388237-b6ae-4a81-b587-558d963edddc] active-fedora (11.5.0) lib/active_fedora/associations/collection_proxy.rb:114:in `select'
[03388237-b6ae-4a81-b587-558d963edddc] hydra-works (0.16.0) lib/hydra/works/models/concerns/work_behavior.rb:49:in `file_sets'
[03388237-b6ae-4a81-b587-558d963edddc] /opt/nurax/shared/bundle/ruby/2.3.0/bundler/gems/hyrax-b64ea8e0d20a/app/controllers/concerns/hyrax/works_controller_behavior.rb:268:in `after_update_response'
[03388237-b6ae-4a81-b587-558d963edddc] /opt/nurax/shared/bundle/ruby/2.3.0/bundler/gems/hyrax-b64ea8e0d20a/app/controllers/concerns/hyrax/works_controller_behavior.rb:101:in `update'
[03388237-b6ae-4a81-b587-558d963edddc] actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
...
@julesies

This comment has been minimized.

julesies commented Nov 3, 2017

Just adding, when I reproduced this - I refreshed after seeing SWW and got the following error: Your changes could not be saved because another user (or background job) updated this Image after you began editing. Please make sure all file attachments have completed successfully and try again. This form has refreshed with the most recent saved copy of the Image.

@mjgiarlo

This comment has been minimized.

Member

mjgiarlo commented Nov 3, 2017

Might you have interest and cycles in taking a gander at this, @jonathandixon?

@jonathandixon

This comment has been minimized.

Contributor

jonathandixon commented Nov 3, 2017

I can take a look first thing Monday if no one else takes it before then.

@jonathandixon jonathandixon self-assigned this Nov 6, 2017

@jonathandixon

This comment has been minimized.

Contributor

jonathandixon commented Nov 6, 2017

I'm thinking this may be a bug in ActiveFedora or ActiveTriples. Here is the simplified code of what produces the error:

work = GenericWork.new
work.state = Vocab::FedoraResourceStatus.active
work.state = work.state
@jonathandixon

This comment has been minimized.

Contributor

jonathandixon commented Nov 6, 2017

Hopefully this will be fixed by this PR: samvera/active_fedora#1286

@jonathandixon jonathandixon removed their assignment Nov 7, 2017

no-reply added a commit that referenced this issue Nov 7, 2017

Bump ActiveFedora version to 12.0.0
We need this release to fix a major bug in the nested works feature. See
samvera/active_fedora#1286 and
#2108.

@no-reply no-reply self-assigned this Nov 7, 2017

@no-reply no-reply added the in progress label Nov 7, 2017

@aeschylus aeschylus removed the ready label Nov 7, 2017

no-reply added a commit that referenced this issue Nov 8, 2017

Bump ActiveFedora dependency to 11.5.1
We need this release to fix a major bug in the nested works feature. See
samvera/active_fedora#1286 and #2108.

Fixes #2108.
@no-reply

This comment has been minimized.

Member

no-reply commented Nov 8, 2017

I think it would be great to get a regression test in for this, given that the eventual fix turns out to be somewhat awkward.

See: samvera/active_fedora#1290

no-reply added a commit that referenced this issue Nov 8, 2017

Bump ActiveFedora dependency to 11.5.2
We need this release to fix a major bug in the nested works feature. See
samvera/active_fedora#1286 and #2108.

Fixes #2108.

@aeschylus aeschylus removed the in progress label Nov 9, 2017

jcoyne added a commit that referenced this issue Dec 5, 2017

Bump ActiveFedora dependency to 11.5.2
We need this release to fix a major bug in the nested works feature. See
samvera/active_fedora#1286 and #2108.

Fixes #2108.

jcoyne added a commit that referenced this issue Dec 5, 2017

Bump ActiveFedora dependency to 11.5.2
We need this release to fix a major bug in the nested works feature. See
samvera/active_fedora#1286 and #2108.

Fixes #2108.

@elrayle elrayle added this to On nurax in 2.1.0 Release Mar 10, 2018

jrochkind added a commit to sciencehistory/chf-sufia that referenced this issue Jun 27, 2018

upgrade active_fedora to 11.5.2
From 11.1.6

To upgrade activefedora we also had to upgrade other dependencies, so as to be compatible.

This is to get a version of active-fedora which fixes this bug:
samvera/hyrax#2108

Which seems to be responsible for this bad behavior in our app:
#1105

It's a mystery why we didn't run into this active-fedora bug until now, but this does seem to fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment