-
Notifications
You must be signed in to change notification settings - Fork 124
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
NoMethodError errors
for <GenericWork> when adding work to two collections of same single membership type (nurax-pg)
#5594
Comments
@gamontoya The issue you were seeing on Koppie, I also saw and @cjcolvar helped me resolve it. It is happening because you need the latest version of rails running on Koppie. This is how you get the latest rails installed on Koppie:
The double error, is what I also saw. I think this is expected behavior, but it would be good to get someone else to confirm that. |
Verified that this is still producing the same error message on nurax-pg. It is also still working but still showing 2 flash error messages on koppie. Reopening and moving to In Progress column on project board for follow-up. |
instructions on how to create a "single membership" collection can be found on hyrax#4011 under the "Steps to reproduce the behavior" heading in the initial comment. |
@dlpierce which error message do we want to remove? the error message above the form is created by #after_update_error and rendered by _flash_msg.html.erb. the error message within the form is created by #full_collections_errors and rendered by _form.html.erb
|
I'm inclined to keep the one rendered by _flash_msg.html.erb, but having it be blank is not ideal. |
@dlpierce agreed. idk why the messages are different between the two, but would you like me to move forward with removing the error message within the form? while I'm at it, should I also remove the entire errors block from the form since the flash msg also handles errors on this page? |
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. these messages would be for the same reason. instead, this commit shows unique error m essages above the form only. ref: #5594 co-authored-by: rob <[email protected]>
This is the behavior I'm seeing on nurax-pg |
@alishaevn And this is the behavior on |
@gamontoya can you check nurax again? the commit sha listed next to the hyrax revision in the footer is the one for the pr related to this work. looks like it was updated yesterday, but I'm unsure if it was before or after you tested. I don't have a login to check for myself either. if it doesn't work for you on nurax, can you try locally? |
@alishaevn Yes, I'm on it! |
@alishaevn This is the latest version of FWIW: I'm getting the same results as yesterday.
|
My local environment is upated: Same behavior for Koppie (it works), unlike pg-nurax |
@gamontoya did your local version of hyrax work? I don't have a login for the pg nurax site so I can't do any debugging there. |
samvera slack message: https://samvera.slack.com/archives/CB69H0SHM/p1686857592249439 |
I created a login for pg nurax and tested this. I got the same problem. from the screenshot above, and my testing, it appears that the works created on pg nurax are considered to be valkyrie works instead of active fedora ones. when I test the hyrax app locally, the works are active fedora backed. I'm unsure why the mixup is happening on nurax. @dlpierce any ideas what's causing this inconsistency? # error from pg
...
hyrax (014fe61dcb0a) app/controllers/concerns/hyrax/works_controller_behavior.rb:203:in `update_valkyrie_work'
hyrax (014fe61dcb0a) app/controllers/concerns/hyrax/works_controller_behavior.rb:104:in `update'
...
____________________________
# code the above error is referencing
def update
case curation_concern
when ActiveFedora::Base
# this code gets run locally for hyrax
actor.update(actor_environment) ? after_update_response : after_update_error(curation_concern.errors)
else
# this code gets run in pg for hyrax
update_valkyrie_work
end
end |
as info, I created two collections as "single membership" on https://dev.nurax.samvera.org and it didn't error at all. I'm not an admin, so I can't see how the collection type is truly configured. I was just going by the name. feels like it is not configured correctly though. |
@alishaevn Hi again! Here's the results from 4 different environments. dev-nurax (works)
pg-nurax (fails)
Local Hyrax (works) Local Koppie (works) |
I went to the hyrax working group standup and mentioned the above issue. pg.nurax.samvera.org IS equivalent to local koppie, while dev.nurax.samvera.org is equivalent to dassie. either way, since the code is working locally for both gabriela and I, daniel wondered if it could be something up with the nurax pg branch that deploys to pg.nurax? maybe a gem is out of date or something? potentially unrelated, but at this moment, the pg branch is 171 commits ahead and 442 commits behind the |
tldr: I paired with @orangewolf to get the pg app running locally and I can now duplicate the issue in the nurax app. |
I changed the gemfile on the nurax |
started a thread in the samvera nurax channel about the above issue. |
…ationHandlingMessageArray before the rails upgrade we would get an "uninitialized constant" error on the above class when running the koppie code on pg nurax staging. this upgrade was needed to get around that. ref: https://github.com/samvera/hyrax/issues/5594\#issuecomment-1599723760
@gamontoya my pr's against the pg app were deployed to pg nurax so this code is ready to be tested again! 🎉 |
@alishaevn I certainly appreciate your persistence--thank you! @rjkati This ticket is now closeable. Issue resolved for pg-nurax:
|
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:
To Reproduce:
See exception shown in Actual behavior.
Related work
Issue #5582
The text was updated successfully, but these errors were encountered: