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

adding a Monograph work to a collection does not appear to complete #5446

Closed
elrayle opened this issue Feb 18, 2022 · 1 comment · Fixed by #5448
Closed

adding a Monograph work to a collection does not appear to complete #5446

elrayle opened this issue Feb 18, 2022 · 1 comment · Fixed by #5448

Comments

@elrayle
Copy link
Contributor

elrayle commented Feb 18, 2022

Descriptive summary

Adding a Valkyrie work to a collection at create or edit time fails to add the work to the collection.

Rationale

Works in collections is core functionality and should work for Valkyrie.

Expected behavior

When creating or editing a work, adding it to an existing collection on the Relationships tab and saving should create the relationship.

Actual behavior

When creating or editing a work, adding it to an existing collection on the Relationships tab and saving appears to be ignored.

Prerequisites:

Configure Hyrax:

  1. Edit /config/initializers/hyrax.rb and set:
  config.collection_model = "Hyrax::PcdmCollection"
  config.query_index_from_valkyrie = true
  config.index_adapter = :solr_index
  1. restart rails app
  2. Make sure regular hyrax-development and hyrax-valkyrie-dev solr cores are running . Your core names may vary depending on how you start them and how they are configured in the app.
  3. Make sure you have access to the datastore (i.e. postgres)

NOTE: For testing of nurax-pg, the solr core is typically named nurax-pg.

Create a collection

  1. navigate to: Dashboard -> Collections
  2. click button: New Collection
  3. select type: anything that doesn't include branding (branding does not work at this time)
  4. click button: Create Collection
  5. set Title: My Collection (or other meaningful name)
  6. click Save

To reproduce:

  1. navigate to: Dashboard -> Works
  2. click button: Add new work
  3. select type: Monograph (needs to be a Valkyrie resource)
  4. fill in required metadata and upload file if needed
  5. click tab: Relationships
  6. under Collections, type collection name created in prerequisites, select, and click button: Add
  7. click button: Save

This forwards to the new work's show page. The Relationships section should show the collection, but is empty.

The same happens if you fully create the work without a relationship, and then edit to add the collection relationship.

Related work

See related issues in Issue #5326 UBER: Hyrax-Valkyrization MVP

@elrayle
Copy link
Contributor Author

elrayle commented Feb 18, 2022

Initial observations:

View processing

  • the view sets existing collections from member_of_collections_json ([Array<Hash>] that holds id:, label:, and path: for each collection)
  • the view returns collection membership changes in member_of_collections_attributes
  • the view does not use or set member_of_collection_ids

Form processing

  • Hyrax::ResourceForm does not set member_of_collections_json
  • Hyrax::ResourceForm does not process member_of_collections_attributes ([Hash<Hash>] that holds id: and _destroy: true|false for each collection change)
  • Hyrax::ResourceForm does not populate or process member_of_collection_ids

See Hyrax::CollectionsMembershipActor to see how member_of_collections_attributes was processed for ActiveFedora.

@elrayle elrayle changed the title When using PcdmCollection, adding a work to a collection does not appear to complete adding a Monograph work to a collection does not appear to complete Feb 18, 2022
@elrayle elrayle self-assigned this Feb 18, 2022
@elrayle elrayle added this to DONE in Hyrax-Valkyrization Mar 1, 2022
@elrayle elrayle moved this from DONE to Ready to be Archived in Hyrax-Valkyrization Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Hyrax-Valkyrization
Ready to be Archived
Development

Successfully merging a pull request may close this issue.

1 participant