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

Issue with adding collections as subcollections #783

Closed
2 tasks
ndroark opened this issue Sep 12, 2023 · 8 comments
Closed
2 tasks

Issue with adding collections as subcollections #783

ndroark opened this issue Sep 12, 2023 · 8 comments
Assignees
Labels
bug Something isn't working Contribute Back maintenance bills to maintenance

Comments

@ndroark
Copy link
Collaborator

ndroark commented Sep 12, 2023

Summary

I am trying to add collections to existing collections (while logged in as a superadmin), but after I select the subcollection from the dropdown list, I get this error message. Occuring in franklin.hykucommons.org.

Image

Acceptance Criteria

  • Any user with collection manager level permissions can add collections to existing collections through the dashboard
  • This code has been contributed to the double combo or main branch (the longest running branch). Note that this rake task doesn't work as is on hyku since hyrax is v5+.

NOTE

This ticket was unrelated to permissions. If collection manager permissions continue, this should be a new ticket.

Testing

Verify that the 3 affected collections in Franklin tenant now show the full list of valid collections to be added as subcollections. The 3 affected collections were College Presidents, Franklin College in the News, and Lasting Legacies.

To test in staging, you would have to find an old collection (prior to 2024), create a new collection, and verify that subcollections can be added to each other.

@ndroark ndroark converted this from a draft issue Sep 12, 2023
@ndroark ndroark added the bug Something isn't working label Sep 12, 2023
@jillpe jillpe added the maintenance bills to maintenance label Oct 23, 2023
@bkiahstroud
Copy link
Contributor

@ndroark can you confirm whether or not this is still an issue?

Based on the screenshot, the intended parent collection is Lasting Legacies: Franklin College 'Spirit of Community' Collection, and the intended subcollection is Judi Warren '80.

Looking at the parent collection now, Judi Warren '80 is a subcollection:

Screenshot 1 image

Though I can tell from the URL that the Collection ID is different, maybe it was recreated?

I created two test collections in the franklin tenant and was able to add one as a subcollection to the other:

Screenshot 2 image

@bkiahstroud bkiahstroud added the question Further information is requested label Nov 17, 2023
@ndroark
Copy link
Collaborator Author

ndroark commented Nov 20, 2023

The issue seems to still be present with at least certain collections in the tenant. For instance, this collection (https://franklin.hykucommons.org/dashboard/collections/39e102cc-551c-4d41-8f26-2d87190ac39f?locale=en) only lists two other collections as available to add to it, and doesn't show up in the list for other collections to be added to.

image

@bkiahstroud bkiahstroud removed the question Further information is requested label Feb 2, 2024
@ndroark
Copy link
Collaborator Author

ndroark commented Feb 29, 2024

This function should be not be limited to superadmins, any user with collection manager level permissions should be able to do this. The specific subcollections in the comments above in the Franklin tenant are the main area where problems have been observed.

@jillpe
Copy link

jillpe commented Mar 1, 2024

This might be associated with the pagination bug in adventist

@ShanaLMoore
Copy link
Contributor

ShanaLMoore commented Mar 1, 2024

possible this may be fixed when upgrading. edit: it's also possible that fix wasn't applied to all controllers though

related tickets (should've been contributed back).

Is there an issue with permissions?

samvera/hyku#2024

notch8/adventist_knapsack#249

@jeremyf
Copy link
Contributor

jeremyf commented Mar 1, 2024

Things to look at:

https://github.com/samvera/hyrax/blob/e9141b81865a37fbc80ab88b44825a51534e6c48/app/controllers/hyrax/my/works_controller.rb#L32-L36

And we need to consider applying the cloning the of the object to the three other locations.

 rg "Hyrax::CollectionsService.new"
app/controllers/concerns/hyrax/works_controller_behavior.rb
173:      Hyrax::CollectionsService.new(self)

app/controllers/hyrax/my/works_controller.rb
35:        Hyrax::CollectionsService.new(cloned)

app/controllers/hyrax/dashboard/collections_controller.rb
387:        Hyrax::CollectionsService.new(self).search_results(:edit)

app/controllers/hyrax/homepage_controller.rb
25:    Hyrax::CollectionsService.new(self).search_results do |builder|

@bkiahstroud bkiahstroud removed their assignment Mar 5, 2024
@laritakr
Copy link
Contributor

laritakr commented Mar 5, 2024

There seem to be 3 collections in the franklin repo that are affected:

These 3 can be added to each other, but are not options for any other collections. All other collections seem to work correctly. So far I have found no reason for this behavior and have been unable to duplicate the behavior locally. Editing and saving the Legacy collection did not fix anything.

These 3 collections seem to have been the first 3 collections created in the franklin tenant. Is it possible something changed in the code prior to the 4th collection being created in March of 2023?

Image

@jillpe jillpe moved this from Ready for Development to Code Review in palni-palci Mar 6, 2024
@laritakr laritakr moved this from Code Review to Deploy to Staging in palni-palci Mar 6, 2024
@laritakr laritakr moved this from Deploy to Staging to SoftServ QA in palni-palci Mar 8, 2024
@laritakr
Copy link
Contributor

✅ Passes QA

  • New collection: https://demo.commons-archive.org/collections/bd47476a-ab14-4688-a82d-b29574ea4a8b?locale=en
  • Ran code from rake task to update collections on all tenants in dev environment (rake task threw faraday errors but code with a few revisions to handle invalid tenants worked from within the rails console.) Now that the collections have been migrated, the rake task is only for documentation purposes.
  • Older collections now show in the list of available subcollections
Before data update

Image

After data update

Image

@laritakr laritakr moved this from SoftServ QA to PALs QA in palni-palci Mar 11, 2024
@ndroark ndroark moved this from PALs QA to Deploy to Production in palni-palci Mar 13, 2024
@jillpe jillpe moved this from Deploy to Production to Client Verification in palni-palci Mar 18, 2024
@ndroark ndroark moved this from Client Verification to Done in palni-palci Mar 19, 2024
@jillpe jillpe closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Contribute Back maintenance bills to maintenance
Projects
Status: Done
Development

No branches or pull requests

7 participants