Needs review
Project:
Drupal core
Version:
main
Component:
ajax system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2026 at 13:14 UTC
Updated:
14 Aug 2026 at 22:26 UTC
Jump to comment: Most recent
Media Library pagination fails inside WYSIWYG within Paragraphs
When clicking the pagination links in the Media Library modal, the modal content is replaced with the node edit page HTML instead of the next page of media items.
Result: The modal content is replaced with the node edit page HTML.
The issue does not occur if one of the left-side tabs (Image, Document, Remote video, etc.) is clicked before using pagination.
As a workaround, I fixed the issue by automatically triggering a click on the first tab when the modal opens.
| Comment | File | Size | Author |
|---|---|---|---|
| Ok with click on tab.mp4 | 755.17 KB | lionel rousseau | |
| Error without click on tab.mp4.mp4 | 1.28 MB | lionel rousseau |
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
cilefen commentedIs this issue related to #3461608: Problems with paragraphs widget when paragraph contains media widget?
Comment #3
lionel rousseau commentedComment #4
tetranz commentedI don't think this is related to Paragraphs. I'm getting the same thing on a normal body field directly on a node with core 11.3.9.
I'm still looking into it.
Comment #5
tetranz commentedIt only happens for me if the media library view uses a full pager. I think the default installation is a mini pager. It works correctly for me if I change it back to a mini pager.
I notice that the videos show a full pager.
Comment #6
lionel rousseau commented@cilefen, no it is not related to #3461608: Problems with paragraphs widget when paragraph contains media widget.
I managed to reproduce the problem without paragraphs.
@tetranz Well spotted ! Changing pagination to a mini pager make it work properly on my website as well. You made my day!
Comment #8
tetranz commentedDisclosure: I used AI (Claude Code) to debug this and create the fix.
This seems to be a regression of https://www.drupal.org/project/drupal/issues/3122526.
A full pager on an AJAX enabled view does not need the use-ajax class added to the links. This is causing it to try to render the whole host form (such as node edit) inside the modal.
I'm sure this is not the only way to fix it but the way this patch works is to add a new #views_ajax_enabled render array key for the full pager. If PagerPreprocess sees this, it does not add the link attributes.
(My first Drupal MR with GitLab),
Comment #9
tetranz commentedComment #10
marcoscanoI think this is the correct direction, but it doesn't seem views-specific, we could have a more generic solution in place, IMO
Comment #11
tetranz commentedYes #modal_dialog_links sounds good. I'll get back to it in a few days if nobody else does. I'm not sure about a change record.
Comment #12
marcoscano👍
Doesn't even seem media-specific either.. changing the component accordingly.
Comment #13
tetranz commentedCode changed as suggested. I'll look at doing a change report.
Comment #14
tetranz commentedI've created a change record. https://www.drupal.org/node/3616887
I'm a little unsure about the branch and version.
Feel free to edit or suggest different wording.