Pagination breaks if there are non-visible media items

Kirby

Well-known member
Affected version
2.3.5
Steps to reproduce
On a fresh install
  1. Set permission View deleted media tiems to Yes for usergroup Moderating
  2. Set category permission View deleted media items in category Example category to No for usergroup Moderating
  3. Create 25 media items in category Example category
  4. Soft-Delete the newest 24 media items
  5. View media gallery home as a moderator (eg. user that is a member of Moderating)
Expected Result
One page with one media item is shown

Actual Result
A message "No media has been added yet." is displayed, but the pagination shows 2 pages - when going to the second page one media item is displayed.

Suggested Fix
Don't show non-visible media items when viewing media gallery home
or
(Overfetch entries and) Retry if displayed count < perpage and there are still more media items available
or
Set finder conditions to only query media items with state != visible that are actually viewable by the visitor (Preferred)
 
Last edited:
Back
Top Bottom