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

undefined method state= when creating Monograph #5084

Closed
elrayle opened this issue Aug 25, 2021 · 12 comments
Closed

undefined method state= when creating Monograph #5084

elrayle opened this issue Aug 25, 2021 · 12 comments
Assignees
Labels
bug needs reproduction Please try to reproduce me!

Comments

@elrayle
Copy link
Contributor

elrayle commented Aug 25, 2021

Descriptive summary

When creating a Monograph through the UI, an exception is raised.

NoMethodError at /concern/monographs
undefined method `state='

The same error does not occur for GenericWork.

Expected behavior

When required data is entered in new work form, a Monograph will be created.

Actual behavior

When required data is entered in new work form, an exception is thrown.

NoMethodError at /concern/monographs
undefined method `state='

Steps to reproduce the behavior

  1. login
  2. navigate to Dashboard -> Works
  3. click Add new work
  4. select Monograph for the work type
  5. fill in required descriptive metadata, add a file, check depositor agreement
  6. save

During save, the exception is raised.

@elrayle elrayle added the bug label Aug 25, 2021
@elrayle
Copy link
Contributor Author

elrayle commented Aug 25, 2021

When the error occurs...

>> target.model_name
=> #<Hyrax::Name:0x00007fbb0fb79a40 @name="FileSet", @klass=#<Class:0x00007fbb8a679ba0>, @singular="file_set", @plural="file_sets", @element="file_set", @human="File set", @collection="file_sets", @param_key="file_set", @i18n_key=:file_set, @route_key="hyrax_file_sets", @singular_route_key="hyrax_file_set">
>> target.is_a? Valkyrie::Resource
=> true
>> target.is_a? Hyrax::FileSet
=> true
>> target.respond_to? :state
=> false

@no-reply no-reply added the needs reproduction Please try to reproduce me! label Sep 30, 2021
@rjkati rjkati self-assigned this Nov 2, 2021
@rjkati
Copy link

rjkati commented Nov 2, 2021

@jlhardes I'm not able to reproduce this on nurax-dev, but I'm not sure if nurax-dev has the proper set up. On nurax-dev, I am able to successfully create a work using the "image" and "generic work" worktypes, but "monograph" is not a work type selection option.

On nurax-pg, I get a "NameError in Hyrax::GenericWorksController#new" error when I try to create either an "image" or "generic work". Monograph is also not a work type selection option on nurax-pg. More info on the error at: #5134 (comment)

@jlhardes
Copy link
Contributor

jlhardes commented Nov 2, 2021

Thanks @rjkati! This might not be specific to Monograph as a work type but more about Valkyrie work to test. @elrayle mentioned on Slack: "The reference to Monograph [in issue reports] is a legacy of the test app in Hyrax that defines some work types as ActiveFedora based and some (including the Monograph) as a Valkyrie resource. In nurax-pg, all work types are Valkyrie resources."

So if you can create works (image or generic work) on nurax-dev then we don't have any issue with the ActiveFedora based code. It looks like this might be more of a Val:MVP issue for testing on nurax-pg?

@rjkati
Copy link

rjkati commented Nov 3, 2021

I tested this on my local docker build (running hyrax 3.0.2) and was able to successfully deposit a monograph without getting the exception error listed above.

@rjkati
Copy link

rjkati commented Nov 4, 2021

In Hyrax Working Group standup, we decided to verify that this works on nurax-dev once the latest hyrax build has been deployed.

@MPLSFedResearchTZ
Copy link

Tried creating works and collections, found the following issue:

  1. When saving the new created collection, there was no response, e.g. message appearing, page redirecting.
  2. After saving the new created work, attached files were not displayed.

Otherwise, did not see any problem.

@jlhardes
Copy link
Contributor

jlhardes commented Nov 9, 2021

I do not see a Monograph work type on nurax-dev, I am still only seeing Generic Work and Image as the types of works that can be created. @MPLSFedResearchTZ were you testing on nurax-dev and able to create a Monograph work? It looks like we might not have Monograph generated as a work type to use yet on nurax-dev, @elrayle?

@MPLSFedResearchTZ
Copy link

@jlhardes I don't see Monograph as a type either. When I tested on nurax-dev, after I created an image type, added a file, the work display page said there were associated files but when I opened the work from the work display page, I could see the image file was at the bottom of the page.

image

image

@jlhardes
Copy link
Contributor

jlhardes commented Dec 6, 2021

Testing on nurax-dev shows a NoMethodError in Hyrax::Monographs#new when selecting Monograph to create a new work, so I'm not able to get beyond step 4 in the steps to reproduce the behavior above. See attached full stack trace:

nurax-dev_stackTraceError_2021-12-06.pdf

@jlhardes
Copy link
Contributor

jlhardes commented Dec 6, 2021

Testing locally with a Docker build running the internal test app .dassie, I am able to create a work as a Monograph with no errors.

@conorom
Copy link
Contributor

conorom commented Mar 2, 2022

I was thinking of looking at this but in our working group stand up just now @fritzfreiheit said he could not recreate it and @elrayle says that is likely because this is fixed already (somewhere else) and so will not happen in dev anymore.

However @elrayle also reckons there may be a problem with how Monographs were created in nurax-pg, so the problem may still happen there. I'll leave this open for another while but there may not be anything to do here.

@elrayle
Copy link
Contributor Author

elrayle commented Mar 2, 2022

In attempting to confirm this is fixed, I tried creating a monograph on nurax-dev. It failed to create, but the error is related to batch processing which is behind a flipper config. When I turned batch upload off, I can confirm that this issue is fixed.

See Issue #5447 for the batch upload related error for Monograph.

@elrayle elrayle closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs reproduction Please try to reproduce me!
Projects
None yet
Development

No branches or pull requests

6 participants