Media Library views fail to reset pager when filters are applied

Created on 8 September 2022, over 2 years ago
Updated 16 April 2024, 8 months ago

Problem/Motivation

When interacting with exposed filters in the Media Library you can get "no results" even when there are valid results, just because the pager does not get reset.

Steps to reproduce

  • Set up a site with the Media Library module enabled and configured for a text format. The Umami demo works great for this.
  • Create enough media items such that they will overflow onto more than one page of results in the media embed modal.
  • Open the media embed modal from a rich text area and page to "page 2" of media results.
  • Search for text that appears only in a small subset of your media items (a small enough subset such that the result set is smaller than one page of results).
  • You'll receive the message "No media available." despite the fact that there is, in fact, media that matches your search term.

This happens because the view still has you on page 2 of the results, and there aren't enough results to flow onto a second page. The pager doesn't even display to give you a clue that this has happened.

Proposed resolution

Reset the pager any time the user interacts with the exposed filters.

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
MediaΒ  β†’

Last updated 4 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States azinck

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024