From 01229a9fc8ec33532d2fc624ea58ffc63817eafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 16 Dec 2022 12:57:39 +0200 Subject: [PATCH] Fixed failing patch for the drupal 9.5. --- ...sed-filters-views-block-on-same-page.patch | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch b/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch index 2e3004b22..e5d4aff17 100644 --- a/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch +++ b/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch @@ -1,8 +1,8 @@ diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php -index e3eaab22e1..f46882c3b0 100644 +index 88e6cecb18..6fe4ec4916 100644 --- a/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php +++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php -@@ -96,7 +96,7 @@ public function testAdministrationPage() { +@@ -105,7 +105,7 @@ public function testAdministrationPage() { // Test that selecting elements as a part of bulk operations works. $page->selectFieldOption('Media type', '- Any -'); @@ -28,10 +28,10 @@ index 9423bb1d64..e85ef75fc6 100644 once('exposed-form', this.$exposed_form).forEach( $.proxy(this.attachExposedFormAjax, this), diff --git a/core/modules/views/js/ajax_view.js b/core/modules/views/js/ajax_view.js -index 225836f4f8..2ddec6f650 100644 +index d824250714..64fb1e568e 100644 --- a/core/modules/views/js/ajax_view.js +++ b/core/modules/views/js/ajax_view.js -@@ -66,7 +66,7 @@ +@@ -55,7 +55,7 @@ } }; this.settings = settings; @@ -40,7 +40,7 @@ index 225836f4f8..2ddec6f650 100644 once('exposed-form', this.$exposed_form).forEach($.proxy(this.attachExposedFormAjax, this)); once('ajax-pager', this.$view.filter($.proxy(this.filterNestedViews, this))).forEach($.proxy(this.attachPagerAjax, this)); var selfSettings = $.extend({}, this.element_settings, { -@@ -124,4 +124,4 @@ +@@ -106,4 +106,4 @@ }, 500); } }; @@ -75,21 +75,21 @@ index bbeb4db276..50eb634674 100644 /** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface $exposed_form_plugin */ $exposed_form_plugin = $view->display_handler->getPlugin('exposed_form'); diff --git a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php -index d877277d72..7e9857fa79 100644 +index 299964e82d..7e9857fa79 100644 --- a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php @@ -32,15 +32,17 @@ public function getCacheContexts() { * context of current view and display ID. */ public function build() { -- $output = $this->view->display_handler->viewExposedFormBlocks(); +- $output = $this->view->display_handler->viewExposedFormBlocks() ?? []; + $output = []; + $build = $this->view->display_handler->viewExposedFormBlocks(); // Provide the context for block build and block view alter hooks. // \Drupal\views\Plugin\Block\ViewsBlock::build() adds the same context in // \Drupal\views\ViewExecutable::buildRenderable() using // \Drupal\views\Plugin\views\display\DisplayPluginBase::buildRenderable(). -- if (is_array($output) && !empty($output)) { +- if (!empty($output)) { - $output += [ + if (is_array($build) && !empty($build)) { + $output = [ @@ -125,10 +125,10 @@ index 5528c4c1fa..11dc0b53ae 100644 + - 'user.node_grants:view' + tags: { } diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php -index f0616d58ab..3b54594e1b 100644 +index d231907de9..9ae86ffb29 100644 --- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php -@@ -259,7 +259,6 @@ public function testExposedBlock($display) { +@@ -262,7 +262,6 @@ public function testExposedBlock($display) { // Test there is only one views exposed form on the page. $xpath = '//form[@id="' . $this->getExpectedExposedFormId($view) . '"]'; $this->assertSession()->elementsCount('xpath', $xpath, 1); @@ -136,7 +136,7 @@ index f0616d58ab..3b54594e1b 100644 // Test that the correct option is selected after form submission. $this->assertCacheContext('url'); -@@ -270,13 +269,14 @@ public function testExposedBlock($display) { +@@ -273,13 +272,14 @@ public function testExposedBlock($display) { 'page' => ['page'], ]; foreach ($arguments as $argument => $bundles) { @@ -154,7 +154,7 @@ index f0616d58ab..3b54594e1b 100644 $this->assertNodesExist($arguments['All']); } -@@ -436,7 +436,7 @@ protected function assertIds(array $ids): void { +@@ -439,7 +439,7 @@ protected function assertIds(array $ids): void { * The form ID. */ protected function getExpectedExposedFormId(ViewExecutable $view) {