UIUCLibrary / teams

An Omeka S module to manage restrictions for users, sites and resources
GNU General Public License v3.0
6 stars 2 forks source link

trash table: not reading omeka setting "items per page" (falls to defaults 10 items per page) #138

Closed mquantin closed 1 year ago

mquantin commented 1 year ago

Hey there, thank you the great work you did. I'm running Teams v4.0.0-rc3

After a csv upload, the uploaded items went to trash "orphaned items" (I may open another issue for this) The trash contains more than 8k items.

The trash table is supposed to list these 8k items 200 by 200 (as specified in the omeka settings) BUT It keeps the "default" omeka behaviour and list them 10 by 10; then the tablbe skips the 190 other remaining ones of the page. screenshot1

If I modify the omeka settings to display only 10 items per page, then The trash table lists all the items. screenshot2

alexdryden commented 1 year ago

Thanks for reporting this. The trash page needs some attention. If I recall this page isn't using the paginate feature built into the API because I hadn't built the API components for Teams yet. That shouldn't be an issue now, and I'll try to get a fix for this and the other issue out tomorrow.

mquantin commented 1 year ago

oh I think you got it, but in case: it's not related to the rest api. It's directly in the admin UI there should be a "per page" integer variable somewhere ... :D

alexdryden commented 1 year ago

Yeah--I think I understand. In this case I mean the PHP API (which is basically a superset of the REST API). For this page I was building the query in the controller instead of making calls to the PHP API where the default per_page user setting is automatically built with the query. So, essentially, the view component that displays the page number and the number of results is sensitive to the user settings but the query and the results returned to the view is not. I'm a little surprised that page 2 starts with result number 201--I would have expected it to start with result 20.

But at any rate, my plan is to rewrite the controller with an api query and add 'orphans' as a query parameter and an api feature so that this feature future defaults will be captured.

alexdryden commented 1 year ago

@mquantin this is fixed in the develop branch. I'm planning on adding some additional work + testing around CSV import and then publishing the 4.0 release later in the week.