hyrax: NoMethodError `errors` for when adding work to two collections of same single membership type (nurax-pg)
Descriptive summary
Adding a work to two collections of the same single membership type raises NoMethodError - undefined method 'errors' for <GenericWork>
Expected behavior
When attempting to add a work to a second collection of the same single membership type, after clicking Save, should stay in the editor and see flash message explaining why this is not allowed.
Actual behavior
When attempting to add a work to a second collection of the same single membership type, after clicking Save, it attempts to stay in the editor but raises an exception…

Steps to reproduce the behavior
On nurax-pg…
Prerequisite:
- Create a collection type that is single membership
- Create two collections of that type
To Reproduce:
- Dashboard -> Works -> Add new work -> select any work type
- Fill in required metadata
- Select tab: Relationships
- In Add to collection selection, type name of first single membership collection and click button: Add
- In Add to collection selection, type name of second single membership collection and click button: Add
- Click button: Save changes
See exception shown in Actual behavior.
Related work
Issue #5582
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (16 by maintainers)
Commits related to this issue
- move work form edit related errors to the flash message. before this commit, the flash message would show an error above the form AND there would be another error messa ge that showed within the form... — committed to samvera/hyrax by alishaevn a year ago
- upgrade rails to ~> 6.1 so that we have access to ActiveModel::DeprecationHandlingMessageArray before the rails upgrade we would get an "uninitialized constant" error on the above class when running ... — committed to samvera-labs/nurax by alishaevn a year ago
@alishaevn I certainly appreciate your persistence–thank you!
@rjkati This ticket is now closeable. Issue resolved for pg-nurax:
@alishaevn Hi again!
Here’s the results from 4 different environments.
dev-nurax (works)
8aa6379a690945148dbb44e518a0037d370a35e1
pg-nurax (fails)
014fe61dcb0a92f83bbe0b1b2c0828147ec4b4f8
Local Hyrax (works)
Local Koppie (works)
@alishaevn
This is the behavior I’m seeing on nurax-pg
Hyrax Version: 4.0.0