[regression] Inserting media via the media library modal when paged redirects to the wrong destination

Created on 12 June 2023, about 1 year ago
Updated 13 June 2023, about 1 year ago

Problem/Motivation

I'm encountering an issue that I think is related to https://www.drupal.org/project/drupal/issues/3364088 🐛 Ajax state leaking to Views destination paths Fixed on the 10.1.x-dev branch. Inserting media after navigating to the second (or more) page in the media modal redirects to /admin/content/media-widget/image with a bunch of query parameters appended rather than returning to the content add or edit page. I only encounter this issue when paging to the second (or more) page in the media modal. If I insert media before paging it works as expected.

Steps to reproduce

  1. Install Drupal 10.1.x-dev with standard profile
  2. Enable the Media and Media Library modules
  3. Add a media entity reference field to the article (or any) content type using the media library widget for the form display (in my testing I referenced image media)
  4. Create enough media entities so that the modal has more than one page of results
  5. Create an article with media. When inserting the media, page to the second page of results and click "Insert selected"

This redirects to:

/admin/content/media-widget/image?media_library_opener_id=media_library.opener.field_widget&media_library_allowed_types%5Bimage%5D=image&media_library_selected_type=image&media_library_remaining=1&media_library_opener_parameters%5Bfield_widget_id%5D=field_hero_image&media_library_opener_parameters%5Bentity_type_id%5D=node&media_library_opener_parameters%5Bbundle%5D=story&media_library_opener_parameters%5Bfield_name%5D=field_hero_image&hash=6XU6pG4r_KQ6oV2O_tf71B7mh0ZP2SPMlZU5IYAVqtg&page=1&ajax_page_state%5Btheme%5D=claro&ajax_page_state%5Btheme_token%5D=uucqv3B3sql3izQWQ6M6AGJpBIo1LSwjcYwu1Jt-cKg&ajax_page_state%5Blibraries%5D=admin_toolbar/toolbar.tree%2Cadmin_toolbar/toolbar.tree.hoverintent%2Cadmin_toolbar_tools/toolbar.icon%2Cbig_pipe/big_pipe%2Cckeditor5/internal.drupal.ckeditor5%2Cckeditor5/internal.drupal.ckeditor5.emphasis%2Cckeditor5/internal.drupal.ckeditor5.htmlEngine%2Cclaro/global-styling%2Cclaro/media_library.theme%2Cclaro/node-form%2Ccontextual/drupal.contextual-links%2Ccontextual/drupal.contextual-toolbar%2Ccore/ckeditor5.autoformat%2Ccore/ckeditor5.basic%2Ccore/ckeditor5.essentials%2Ccore/ckeditor5.htmlSupport%2Ccore/ckeditor5.link%2Ccore/ckeditor5.pasteFromOffice%2Ccore/ckeditor5.sourceEditing%2Ccore/drupal.active-link%2Ccore/drupal.collapse%2Ccore/drupal.dropbutton%2Ccore/drupal.entity-form%2Ccore/drupal.form%2Ccore/drupal.states%2Ccore/drupal.tableresponsive%2Ccore/internal.jquery.form%2Ccore/normalize%2Cfield_group/core%2Cfield_group/formatter.fieldset%2Cfile/drupal.file%2Cfilter/drupal.filter%2Clinkit/ckeditor5%2Cmedia_library/ui%2Cmedia_library/widget%2Cnode/drupal.node%2Cnode/form%2Cparagraphs/drupal.paragraphs.widget%2Cpath/drupal.path%2Cpathauto/widget%2Cshortcut/drupal.shortcut%2Csystem/admin%2Csystem/base%2Ctoolbar/toolbar%2Ctoolbar/toolbar.escapeAdmin%2Ctour/tour%2Cuser/drupal.user.icons%2Cviews/views.ajax%2Cviews/views.module`
🐛 Bug report
Status

Fixed

Version

10.1

Component
Views 

Last updated about 4 hours ago

Created by

🇺🇸United States dmurphy1

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

Comments & Activities

Production build 0.69.0 2024