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

Hyrax::PcdmCollectionForm does not support #permission_template #5329

Closed
elrayle opened this issue Jan 20, 2022 · 0 comments · Fixed by #5402
Closed

Hyrax::PcdmCollectionForm does not support #permission_template #5329

elrayle opened this issue Jan 20, 2022 · 0 comments · Fixed by #5402
Assignees

Comments

@elrayle
Copy link
Contributor

elrayle commented Jan 20, 2022

Descriptive summary

When editing a collection, the Sharing tab allows the user to set default permissions for works created in that collection and the Discoverable tab allows the user to set the visibility of the collection. The view hyrax/dashbaord/collections/_form_share.html.erb uses @form.permission_template to construct the form allowing the user to add access. Similarly, the view hyrax/dashboard/collections/_form_discovery.html.erb uses @form.permission_template to determine the current visibility of the collection.

When working with Hyrax::PcdmCollections (Valkyrie::Resource), the Hyrax::PcdmCollectionForm (Valkyrie::ChangeSet) is used. At this time, it does not support #permission_template. This error impacts Sharing and Discovery tabs of the collection edit form.

Rationale

Working with AF Collections or Valkyrie Collections, the Sharing and Discovery tabs should allow users to set default permissions and visibility, respectively, for the collection.

Expected behavior

Editing a Hyrax::PcdmCollection should load the edit form, including the Sharing and Discovery tabs.

Actual behavior

Editing a Hyrax::PcdmCollection fails to load the edit form for multiple reasons. One includes the inability to load the Sharing and Discovery tabs because the @form object does not support the #permission_template method.

image

Steps to reproduce the behavior

Prerequisites:

Edit /config/initializers/hyrax.rb and set:

  config.colleccollectiontion_model = "Hyrax::PcdmCollection"

To isolate issues in other tabs, create a collection_type with all options off except Discovery.

  1. navigate to Dashboard -> Settings -> Collection Types
  2. click button: Create new collection type
  3. set Type name: Discovery only (or other meaningful name)
  4. click button: Save
  5. click tab: Settings
  6. set to only have Discovery turned on (as seen below)
  7. click button: Save changes

image

To reproduce:

  1. navigate to Dashboard -> Collections
  2. click button: New Collection
  3. select type: Discovery only (or the name you used when creating the collection type)
  4. click button: Create Collection
  5. set Title: My Discoverable Collection (or other meaningful name)
  6. click Save (this loads the editor for the collection including the Discovery tab)

The error will occur as the edit form tries to load.

NOTE: There may be other errors on the Discovery tab once this error is resolved.
NOTE: This impacts the Sharing tab as well. Once a fix is in place for the Discovery tab, test the Sharing tab.

Related work

See related issues in Issue #5326 UBER: Hyrax-Valkyrization MVP
Issue #5400 is the same error for AdministrativeSets

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

Successfully merging a pull request may close this issue.

2 participants