- Issue created by @dmurphy1
- 🇬🇧United Kingdom catch
I can reproduce manually but haven't been able to track down the bug yet.
This bit of
MediaLibrarySelectForm
is a bit suspicious// @todo Remove in https://www.drupal.org/project/drupal/issues/2504115 // Currently the default URL for all AJAX form elements is the current URL, // not the form action. This causes bugs when this form is rendered from an // AJAX path like /views/ajax, which cannot process AJAX form submits. $query = $this->view->getRequest()->query->all(); $query[FormBuilderInterface::AJAX_FORM_REQUEST] = TRUE; $query['views_display_id'] = $this->view->getDisplay()->display['id']; $form['actions']['submit']['#ajax'] = [ 'url' => Url::fromRoute('media_library.ui'), 'options' => [ 'query' => $query, ], 'callback' => [static::class, 'updateWidget'], // The AJAX system automatically moves focus to the first tabbable // element of the modal, so we need to disable refocus on the button. 'disable-refocus' => TRUE, ];
- 🇮🇳India shailja179 India
@dmurphy1 ,
Can you give the steps to reproduce the issue? - Status changed to Needs review
over 1 year ago 12:43pm 13 June 2023 - last update
over 1 year ago 29,424 pass, 1 fail - last update
over 1 year ago 29,425 pass - 🇫🇮Finland lauriii Finland
I was able to reproduce this with the steps from the issue summary.
Here's a fix and some additional test coverage.
- last update
over 1 year ago 29,425 pass The last submitted patch, 4: 3366287-4-test-only.patch, failed testing. View results →
9:44 8:41 RunningThe last submitted patch, 7: 3366287-5-test-only.patch, failed testing. View results →
- Status changed to RTBC
over 1 year ago 3:02pm 13 June 2023 - 🇬🇧United Kingdom catch
OK same error as #4, if I'd read more closely I might have realised this.
I discussed this a fair bit with @lauriii in slack, it was very hard to track down and he beat me to it, but in the end it's a very simple fix. It would be good to have more low-level test coverage of this but there's so many steps involved in testing with media library I'm not sure what that would look like, just testing the event subscriber in isolation wouldn't tell us it's doing the right thing if logic changes elsewhere.
- last update
over 1 year ago CI aborted - 🇺🇸United States dmurphy1
+1 RTBC as well. Nice work tracking this bug down!
-
larowlan →
committed c9af197e on 10.1.x
Issue #3366287 by lauriii, catch, dmurphy1: [regression] Inserting media...
-
larowlan →
committed c9af197e on 10.1.x
-
larowlan →
committed d5740e4b on 11.x
Issue #3366287 by lauriii, catch, dmurphy1: [regression] Inserting media...
-
larowlan →
committed d5740e4b on 11.x
- Status changed to Fixed
over 1 year ago 11:04pm 13 June 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Thanks all, committed to 11.x and backported to 10.1.x
Automatically closed - issue fixed for 2 weeks with no activity.