samvera-labs / nurax-pg

This is a Hyrax application configured to use Postgres for metadata storage instead of ActiveFedora.
Apache License 2.0
0 stars 0 forks source link

non-wings adapter cannot edit collections and works #24

Open elrayle opened 2 years ago

elrayle commented 2 years ago

Descriptive summary

When using the postgres adapter in nurax-pg, works and collections get the same Valkyrie::Persistence::ObjectNotFoundError when you try to edit an existing work or collection. This is caused by the alternate_ids not getting set when the work/collection is created. The edit process expects to be able to read the work/collection back in by searching for postgres for an alternate identifier equal to the id.

Rationale

Editing should work for wings adapter and non-wings adapters.

Expected behavior

Dashboard -> Works -> edit work -> should display the work edit form

Actual behavior

Dashboard -> Works -> edit work -> raises Valkyrie::Persistence::ObjectNotFoundError in the query_service #find_by_alternate_identifier method.

image

Steps to reproduce the behavior

Prereq: Create a valkyrie resource type work. On nurax-pg, all work types are valkyrie resource work types.

  1. Login to nurax-pg
  2. Dashboard -> Works
  3. Click the action menu beside an existing work
  4. Select Edit Work
  5. Modify the title
  6. Save

Related work

Issue #5135 - Val MVP: Edit works as a valkyrie resource through UI

elrayle commented 2 years ago

This happens because noids are enabled (in hyrax initializer), but noids are not being saved in the alternate_ids. A temporary fix is to disable noids. You should be able to edit works again.

I'm leaving this issue open to track remaining work.

Remaining work

See https://github.com/samvera/hyrax/issues/5246 for more information on the error related to noids not being populated in the alternate_ids.

Once fixed, enable noids and retest.

jlhardes commented 2 years ago

Testing this on nurax-pg now shows that the steps work and there are no errors but I don't know if custom ID generation is supported yet or not (enable noids).