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

Bug: 500 error when adding work to collection #892

Open
2 tasks
ndroark opened this issue Oct 30, 2023 · 3 comments
Open
2 tasks

Bug: 500 error when adding work to collection #892

ndroark opened this issue Oct 30, 2023 · 3 comments
Assignees
Labels
bug Something isn't working maintenance bills to maintenance

Comments

@ndroark
Copy link
Collaborator

ndroark commented Oct 30, 2023

Attempting to add Letter to Chancy Butler, February 10th, 1862 to the Ovid Butler Digital Collection in butler.hykucommons.org produces a 500 error.

image

Acceptance Criteria

Testing

  • Create a work with a location value
  • Add work to a collection

Verify that add to collection is successful.

@ndroark ndroark added the bug Something isn't working label Oct 30, 2023
@ShanaLMoore
Copy link
Contributor

Screenshot 2023-10-30 at 2 46 34 PM

@jillpe jillpe added the maintenance bills to maintenance label Nov 7, 2023
@bkiahstroud bkiahstroud self-assigned this Nov 7, 2023
@bkiahstroud
Copy link
Contributor

This seems like it may be an issue between Wings, the OrderAlready gem, and the based_near field in Hyrax v3.6.0:

# based_near value: [#<Hyrax::ControlledVocabularies::Location:0x9c234 ID:<https://sws.geonames.org/4259418/>>]

af_work = GenericWork.find(<id>)
wings_work = Hyrax.query_service.find_by(id: <id>) # instance of Hyrax::Work

af_work.save!
=> true

Hyrax.persister.save(resource: wings_work)
=> Traceback (most recent call last):
        6: from (irb):113
        5: from config/initializers/order_already_overrides.rb:13:in `serialize'
        4: from config/initializers/order_already_overrides.rb:29:in `sanitize'
        3: from config/initializers/order_already_overrides.rb:29:in `each_with_index'
        2: from config/initializers/order_already_overrides.rb:29:in `each'
        1: from config/initializers/order_already_overrides.rb:30:in `block in sanitize'
NoMethodError (undefined method `empty?' for #<RDF::URI:0x9a420 URI:https://sws.geonames.org/4259418/>)

I’m pretty sure the error is being thrown on this line:

# Wings::ActiveFedoraConverter#apply_attributes_to_model
af_object.attributes = converted_attrs

My current theory is that it may somehow be related to how OrderAlready overrides based_near=, OR how it doesn’t override based_near= for the Wings version of the record

@laritakr laritakr self-assigned this Mar 7, 2024
laritakr added a commit that referenced this issue Mar 8, 2024
Ordering based_near causes several issues:
- adding a work to a collection fails
- adding a work outside of the actor stack turned the attribute into a string.

Refs:
- #892
- #964
@bkiahstroud bkiahstroud removed their assignment Mar 8, 2024
ShanaLMoore pushed a commit to samvera/hyku that referenced this issue Mar 21, 2024
Ordering based_near causes several issues:
- adding a work to a collection fails
- adding a work outside of the actor stack turned the attribute into a string.

Refs:
- scientist-softserv/palni-palci#892
- scientist-softserv/palni-palci#964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maintenance bills to maintenance
Projects
Status: Done
Development

No branches or pull requests

5 participants