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

Cannot add works to collections #4993

Closed
jlhardes opened this issue Jun 8, 2021 · 10 comments
Closed

Cannot add works to collections #4993

jlhardes opened this issue Jun 8, 2021 · 10 comments
Assignees
Milestone

Comments

@jlhardes
Copy link
Contributor

jlhardes commented Jun 8, 2021

Descriptive summary

Regardless of collection type, works cannot be added to collections or deposited in collections.

Rationale

This is a bug and we should be able to add works to collections or deposit works directly into collections.

Expected behavior

Existing works should be addable to collections and works should be createable by being deposited into collections.

Actual behavior

When adding an existing work to a collection or trying to deposit a work to a collection, the action fails with an error message specifically about single-membership collection type. The error message shows in an info message-style bubble.

Steps to reproduce the behavior

  1. On nurax-dev, log in as either admin user or regular logged in user
  2. Create a new collection (I have tried type User Collection, type Multiple Membership A, and type Collection Type 10: discover, share, multi)
  3. Select a public Work and Add to Collection
  4. Find that collection in the drop-down search box prompt
  5. Click Save
  6. Receive following error message (in a yellow non-error message bubble): "Collections Error: You have specified more than one of the same single-membership collection type (type: User Collection, collections: shared collection 3, CPD > Grammar > Vocab, cb_1.5.2, Test collection 2, and test collection)"
  7. Can also try going into a collection view and "Deposit new work through this collection" to create a new work within a collection - same resulting error message
  8. Compare error message with attached screenshot

Screen Shot 2021-06-08 at 3 09 07 PM

Related work

I was trying to QA the following PR when I discovered this was happening, but I'm not sure if there's a connection: #4980

@jlhardes jlhardes added the bug label Jun 8, 2021
@jlhardes
Copy link
Contributor Author

jlhardes commented Jun 8, 2021

After testing locally, this might not be a bug (or not the bug I thought it was). The collection type User Collection appears to have limitations, mainly that there can be only one. I didn't realize I already had a collection of type User Collection created locally (under a different user account) so I created a User Collection and tried to add a work to it. I received the same informational error message but it listed the 2 User Collection collection names on my local instance. So if we reduce the number of User Collections on nurax-dev to just one, it might be possible to add works to collections again. I'm not sure why multiple User Collections is preventing any work from being added to any collection, though, so there still might be something wrong here.

@jlhardes
Copy link
Contributor Author

jlhardes commented Jun 9, 2021

There are 203 collections of the type User Collection on nurax-dev right now so it seems unlikely that what I thought I found regarding collection type is actually causing the problem here. Locally, once I reduced my User Collection collection types down to a single collection of that type, I was able to add works to collections again. I am not sure how to troubleshoot at this point to figure out why works are not able to be added to collections.

@jlhardes
Copy link
Contributor Author

jlhardes commented Jun 9, 2021

More testing on both nurax-dev and locally is hopefully helpful but I really can't tell yet. Locally I created a new collection type that is multi member and shared so there is something besides the User Collection collection type. Then I created a collection for that multi member collection type. This meant that locally there was 1 collection for the User Collection collection type and 1 collection for the multi member collection type. In that situation, works can be added to collections.

I created another collection that is the multi member collection type so there is 1 User Collection collection and 2 multi member collections. At that point I was not able to add works to any collections, regardless of collection type, and received the error and it listed those 2 multi member collections as the problem.

Screen Shot 2021-06-09 at 9 36 41 AM

So then I went to nurax-dev. I created a new collection type and then created a collection so there was only 1 collection using that collection type. I then tried to add a work to it and received the same error message as before on nurax-dev saying User Collection collection types are the problem.

I went back to my local instance and created another User Collection so I then have 2 User Collections and 2 multi member collections. I tried adding a work to the new User Collection and received an error message that lists both the 2 User Collections and the 2 multi member collections as problems:

Screen Shot 2021-06-09 at 1 46 00 PM

So this is seeming like a situation where any collection type that has multiple collections of that type is causing a problem for adding works to any collection, regardless of collection type. The same single-membership message is always showing but the collection types and the collections listed as problems are varying.

@no-reply
Copy link
Contributor

@jlhardes are we at a place with this where there are steps to reproduce on a fresh Hyrax deploy or dev environment?

@no-reply no-reply added this to the 3.x series milestone Jun 11, 2021
@jlhardes
Copy link
Contributor Author

Looks like this is happening on the Notch8 demo site right now. I just signed up as a new user and I am not able to create a new work directly in the Works area of the dashboard. I tried creating a new User Collection and was able to do that but then depositing a new work in that collection gave me this same error: Collections Error: You have specified more than one of the same single-membership collection type (type: User Collection, collections: PDF Testing and Test 1)

@no-reply no-reply self-assigned this Aug 10, 2021
@elrayle
Copy link
Contributor

elrayle commented Aug 31, 2021

@jlhardes Has this been retested since PR #5055 which was merged July 28? What version was Notch8 using on their demo site?

@jlhardes
Copy link
Contributor Author

The Notch8 demo site is on 3.0.2 (released May 7) so that site's code might be prior to PR #5055 being merged. I just tried locally with all of the latest code changes and I can create a User Collection and deposit a work directly to that collection and add a work that already exists to that same collection without errors. I also tried on nurax-dev which looks like it has the latest changes as of 5 days ago and I can also do all the same actions there with no errors (Hyrax Revision on nurax-dev: https://github.com/samvera/hyrax/tree/16f164dd98825f54a0e3cbd3ea47c34450f4d81c).

@elrayle
Copy link
Contributor

elrayle commented Sep 1, 2021

@jlhardes Can this issue be closed with PR #5055 being identified as the fix?

@jlhardes
Copy link
Contributor Author

jlhardes commented Sep 1, 2021

I do think this can be closed but I want to verify with @no-reply about the Notch8 demo site code version. Is that demo site at 3.0.2 without any further code changes? No other instance that I am trying now is showing that error so I think this issue is fixed with current code.

@jlhardes
Copy link
Contributor Author

Verified that Notch8 demo site is not using latest code so this issue is fixed and closed.

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

No branches or pull requests

3 participants