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 1/4] 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) { From 1659a8ea690207847e4b0da52344e964f38fbeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 16 Dec 2022 13:00:05 +0200 Subject: [PATCH 2/4] Applied the fixed patch. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f28dd305d..19673959a 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "drupal/core": { "[#UHF-181] Hide untranslated menu links": "https://www.drupal.org/files/issues/2021-03-05/3091246-allow-menu-tree-manipulators-alter-12-1.patch", "[#UHF-920] Token for base URL (https://www.drupal.org/project/drupal/issues/1088112).": "https://www.drupal.org/files/issues/2020-10-06/1088112-63.patch", - "[#UHF-3812] Ajax exposed filters not working for multiple instances of the same Views block placed on one page (https://www.drupal.org/project/drupal/issues/3163299). Re-rolled for hel.fi": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/83eb65d99327bf9c9c67ca4f7c1220ae3d8e2eae/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch", + "[#UHF-3812] Ajax exposed filters not working for multiple instances of the same Views block placed on one page (https://www.drupal.org/project/drupal/issues/3163299). Re-rolled for hel.fi": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/01229a9fc8ec33532d2fc624ea58ffc63817eafd/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch", "[#UHF-3087] Non-published menu links as parent (https://www.drupal.org/project/drupal/issues/2807629)": "https://www.drupal.org/files/issues/2021-07-09/2807629-45.patch", "[#UHF-4325] Strip whitespaces from twig debug comments": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/f7c0e380e2deb9a1b46bdf779fb27a945b466575/patches/drupal_core_strip_debug_mode_whitespaces_9.3.x.patch", "[#UHF-7008] Core localization file download URL is wrong (https://www.drupal.org/project/drupal/issues/3022876)": "https://git.drupalcode.org/project/drupal/-/commit/40a96136b2dfe4322338508dffa636f6cb407900.patch", From 3f08ce74ce6335f5685ad010f94108a7eb9c470f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 16 Dec 2022 13:08:49 +0200 Subject: [PATCH 3/4] Added drupal 9.5 to conflict sections. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 19673959a..407bf530e 100644 --- a/composer.json +++ b/composer.json @@ -63,6 +63,7 @@ "drupal/views_bulk_operations": "^4.1" }, "conflict": { + "drupal/core-recommended": "<9.5", "drupal/ctools": "<3.11 || ^4.0.1" }, "extra": { From 845dc9347507680c2c8a64cf6eb4b87412fb60e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 16 Dec 2022 13:15:57 +0200 Subject: [PATCH 4/4] Updated Non-published menu links as parent patch for drupal 9.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 407bf530e..c6283d7b3 100644 --- a/composer.json +++ b/composer.json @@ -75,7 +75,7 @@ "[#UHF-181] Hide untranslated menu links": "https://www.drupal.org/files/issues/2021-03-05/3091246-allow-menu-tree-manipulators-alter-12-1.patch", "[#UHF-920] Token for base URL (https://www.drupal.org/project/drupal/issues/1088112).": "https://www.drupal.org/files/issues/2020-10-06/1088112-63.patch", "[#UHF-3812] Ajax exposed filters not working for multiple instances of the same Views block placed on one page (https://www.drupal.org/project/drupal/issues/3163299). Re-rolled for hel.fi": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/01229a9fc8ec33532d2fc624ea58ffc63817eafd/patches/drupal-3163299-ajax-exposed-filters-views-block-on-same-page.patch", - "[#UHF-3087] Non-published menu links as parent (https://www.drupal.org/project/drupal/issues/2807629)": "https://www.drupal.org/files/issues/2021-07-09/2807629-45.patch", + "[#UHF-3087] Non-published menu links as parent (https://www.drupal.org/project/drupal/issues/2807629)": "https://www.drupal.org/files/issues/2022-12-16/2807629-75.patch", "[#UHF-4325] Strip whitespaces from twig debug comments": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/f7c0e380e2deb9a1b46bdf779fb27a945b466575/patches/drupal_core_strip_debug_mode_whitespaces_9.3.x.patch", "[#UHF-7008] Core localization file download URL is wrong (https://www.drupal.org/project/drupal/issues/3022876)": "https://git.drupalcode.org/project/drupal/-/commit/40a96136b2dfe4322338508dffa636f6cb407900.patch", "[#UHF-7008] Add multilingual support for caching basefield definitions (https://www.drupal.org/project/drupal/issues/3114824)": "https://www.drupal.org/files/issues/2020-02-20/3114824_2.patch",