Media Library: Cannot insert media selected from a different pager page

Created on 3 September 2025, 2 days ago

Problem/Motivation

When using the Media Library with a pager, selecting a media item from a different pager page and then clicking "Insert" does nothing. The "Insert" action only works if the media item is selected on the same page where the user clicks "Insert". This prevents editors from inserting media items that are not on the first/visible pager page.

Steps to reproduce

1. Open a Media Library field in a node form.
2. Use the pager to navigate to the second (or any other) page of media items.
3. Select an image from that page.
4. Click on "Insert selected".
5. Observe that nothing happens.
6. Now, select an image from the same page (without using the pager).
7. Click "Insert selected" the image is correctly inserted.

Proposed resolution

Ensure that selected media items from any pager page are properly tracked and passed to the "Insert selected" action, not just those selected on the current page.

Remaining tasks

- Debug why selected items are not being recognized after pager navigation. - Update the JavaScript selection handling so selections persist across pager pages. - Add test coverage for selecting and inserting media from multiple pager pages.

User interface changes

None expected, only functional fix.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

Fixed an issue where selecting media items from different pager pages in the Media Library prevented them from being inserted.

πŸ› Bug report
Status

Active

Version

11.2 πŸ”₯

Component

media system

Created by

πŸ‡―πŸ‡΄Jordan ahmad abbad Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024