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

Pagination breaks depositing works into a collection #6006

Closed
bkiahstroud opened this issue Apr 18, 2023 · 1 comment
Closed

Pagination breaks depositing works into a collection #6006

bkiahstroud opened this issue Apr 18, 2023 · 1 comment
Labels

Comments

@bkiahstroud
Copy link
Contributor

Descriptive summary

Version: hyrax-v3.5.0

As an admin, when I attempt to deposit a work into an existing collection, I see the following message:

You do not have access to any existing collections. You may create a new collection.

This behavior ONLY happens on pages 2+ of works in the admin dashboard. Selecting a work from the first page of results will succeed.

Screenshots

image

Rationale

🐛🥾

Expected behavior

When I attempt to add any work(s) from pages 2+, they should deposit into the collection successfully.

Actual behavior

When I attempt to add any work(s) from pages 2+, I see a message saying I don't have access, even when I am supposed to.

Steps to reproduce the behavior

  1. Spin up the .dassie Docker app locally (instructions)
  2. Login as [email protected]
  3. Create a Collection with the title Test Collection
  4. Create 15 Generic Works1
  5. Navigate to Dashboard > Collections > Test Collection
  6. Click Add existing works to this collection
  7. In the pagination menu at the bottom left of the page, click Next
  8. Check the Select checkbox next to any work
  9. Click the Add to collection button at the top of the list
  10. A modal appears with a message saying you don't have access

1 Running the script below in a rails console might be helpful

Create many works quickly
15.times do |i|
  GenericWork.create!(title: ["Work #{i}"], depositor: '[email protected]', creator: ['me'], rights_statement: ['http://rightsstatements.org/vocab/CNE/1.0/'])
end

Related work

Notes from initial investigation (bkiahstroud)

The URL (/dashboard/my/works/page/2) stood out to me as odd... typically, instead of seeing /page/2 used for pagination, I've seen it like ?page=2.

I think the page parameter itself may be related to the root cause of the issue. Removing that param using a debugger, it appeared as though I had access like normal.


This bug was originally reported by / investigated for PALNI/PALCI's Hyku for Consortia Hyku project (Hyrax version: v3.4.2)

@jlhardes
Copy link
Contributor

I could not recreate this problem in Hyrax 5.0.0 on https://dev.nurax.samvera.org/. I was able to select works from the second page of my works list and add them to the selected collection without any errors. I did this twice and it worked both times.

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

No branches or pull requests

3 participants