From 22c30dc2e485923ccb2e9598132d657e989e5d46 Mon Sep 17 00:00:00 2001
From: "lee.5151" <lee.5151@osu.edu>
Date: Mon, 28 Nov 2022 13:02:10 -0500
Subject: [PATCH] Upgrading drupal/menu_block (1.7.0 => 1.10.0)

---
 composer.json                                 |  2 +-
 composer.lock                                 | 42 ++++++-------
 vendor/composer/installed.json                | 62 +++++++++----------
 vendor/composer/installed.php                 | 22 +++----
 vendor/symfony/http-foundation/IpUtils.php    |  9 +++
 .../Constraint/ResponseCookieValueSame.php    |  2 +-
 .../NotTaggedControllerValueResolver.php      |  5 +-
 vendor/symfony/http-kernel/Kernel.php         |  6 +-
 web/modules/menu_block/README.txt             |  9 +++
 web/modules/menu_block/menu_block.info.yml    |  8 +--
 web/modules/menu_block/menu_block.module      | 11 ++++
 .../MenuBlockKernelViewSubscriber.php         |  6 +-
 .../menu_block/src/Plugin/Block/MenuBlock.php | 26 ++++----
 .../menu_block_test/menu_block_test.info.yml  |  8 +--
 .../tests/src/Functional/MenuBlockTest.php    | 12 ++--
 15 files changed, 131 insertions(+), 99 deletions(-)

diff --git a/composer.json b/composer.json
index fdb70b8e51..7bb0a2278e 100644
--- a/composer.json
+++ b/composer.json
@@ -135,7 +135,7 @@
         "drupal/media_entity_browser": "2.0-alpha3",
         "drupal/media_entity_file_replace": "^1.0",
         "drupal/media_entity_twitter": "2.7",
-        "drupal/menu_block": "1.7",
+        "drupal/menu_block": "1.10",
         "drupal/menu_breadcrumb": "1.16",
         "drupal/metatag": "1.16",
         "drupal/migrate_devel": "2.0-alpha2",
diff --git a/composer.lock b/composer.lock
index 9f77354148..d1b91b0b88 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "34725321c1b77f13acdd41e96c52fb5d",
+    "content-hash": "c733c9a784a8d9a62166c6999c16be18",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -5510,26 +5510,26 @@
         },
         {
             "name": "drupal/menu_block",
-            "version": "1.7.0",
+            "version": "1.10.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/menu_block.git",
-                "reference": "8.x-1.7"
+                "reference": "8.x-1.10"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/menu_block-8.x-1.7.zip",
-                "reference": "8.x-1.7",
-                "shasum": "6d021a24a6a8691becbecf02ac236a7d8626d4d0"
+                "url": "https://ftp.drupal.org/files/projects/menu_block-8.x-1.10.zip",
+                "reference": "8.x-1.10",
+                "shasum": "97de632d77448ae0a974e20c2ffbe42c7ddd4633"
             },
             "require": {
-                "drupal/core": "^8 || ^9"
+                "drupal/core": "^9.1 || ^10"
             },
             "type": "drupal-module",
             "extra": {
                 "drupal": {
-                    "version": "8.x-1.7",
-                    "datestamp": "1619638238",
+                    "version": "8.x-1.10",
+                    "datestamp": "1667434255",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
@@ -13981,16 +13981,16 @@
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v4.4.48",
+            "version": "v4.4.49",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-foundation.git",
-                "reference": "cd4f478e67f7c8776a13b17e7d44241fd66261ad"
+                "reference": "191413c7b832c015bb38eae963f2e57498c3c173"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cd4f478e67f7c8776a13b17e7d44241fd66261ad",
-                "reference": "cd4f478e67f7c8776a13b17e7d44241fd66261ad",
+                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/191413c7b832c015bb38eae963f2e57498c3c173",
+                "reference": "191413c7b832c015bb38eae963f2e57498c3c173",
                 "shasum": ""
             },
             "require": {
@@ -14029,7 +14029,7 @@
             "description": "Defines an object-oriented layer for the HTTP specification",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-foundation/tree/v4.4.48"
+                "source": "https://github.com/symfony/http-foundation/tree/v4.4.49"
             },
             "funding": [
                 {
@@ -14045,20 +14045,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-10-12T09:40:54+00:00"
+            "time": "2022-11-04T16:17:57+00:00"
         },
         {
             "name": "symfony/http-kernel",
-            "version": "v4.4.48",
+            "version": "v4.4.49",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-kernel.git",
-                "reference": "a6d5229dd9466e046674baad8449ad92ee24eddd"
+                "reference": "4e36db8103062c62b3882b1bd297b02de6b021c4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a6d5229dd9466e046674baad8449ad92ee24eddd",
-                "reference": "a6d5229dd9466e046674baad8449ad92ee24eddd",
+                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4e36db8103062c62b3882b1bd297b02de6b021c4",
+                "reference": "4e36db8103062c62b3882b1bd297b02de6b021c4",
                 "shasum": ""
             },
             "require": {
@@ -14133,7 +14133,7 @@
             "description": "Provides a structured process for converting a Request into a Response",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-kernel/tree/v4.4.48"
+                "source": "https://github.com/symfony/http-kernel/tree/v4.4.49"
             },
             "funding": [
                 {
@@ -14149,7 +14149,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-10-28T16:49:22+00:00"
+            "time": "2022-11-28T17:58:43+00:00"
         },
         {
             "name": "symfony/mime",
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index ffdd21e445..de82c4bcce 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -5698,27 +5698,27 @@
         },
         {
             "name": "drupal/menu_block",
-            "version": "1.7.0",
-            "version_normalized": "1.7.0.0",
+            "version": "1.10.0",
+            "version_normalized": "1.10.0.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/menu_block.git",
-                "reference": "8.x-1.7"
+                "reference": "8.x-1.10"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/menu_block-8.x-1.7.zip",
-                "reference": "8.x-1.7",
-                "shasum": "6d021a24a6a8691becbecf02ac236a7d8626d4d0"
+                "url": "https://ftp.drupal.org/files/projects/menu_block-8.x-1.10.zip",
+                "reference": "8.x-1.10",
+                "shasum": "97de632d77448ae0a974e20c2ffbe42c7ddd4633"
             },
             "require": {
-                "drupal/core": "^8 || ^9"
+                "drupal/core": "^9.1 || ^10"
             },
             "type": "drupal-module",
             "extra": {
                 "drupal": {
-                    "version": "8.x-1.7",
-                    "datestamp": "1619638238",
+                    "version": "8.x-1.10",
+                    "datestamp": "1667434255",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
@@ -5735,22 +5735,22 @@
                     "name": "Dave Reid",
                     "homepage": "https://www.drupal.org/user/53892"
                 },
-                {
-                    "name": "JohnAlbin",
-                    "homepage": "https://www.drupal.org/user/32095"
-                },
-                {
-                    "name": "RenatoG",
-                    "homepage": "https://www.drupal.org/user/3326031"
-                },
                 {
                     "name": "joelpittet",
                     "homepage": "https://www.drupal.org/user/160302"
                 },
+                {
+                    "name": "JohnAlbin",
+                    "homepage": "https://www.drupal.org/user/32095"
+                },
                 {
                     "name": "kim.pepper",
                     "homepage": "https://www.drupal.org/user/370574"
                 },
+                {
+                    "name": "RenatoG",
+                    "homepage": "https://www.drupal.org/user/3326031"
+                },
                 {
                     "name": "rrrob",
                     "homepage": "https://www.drupal.org/user/273533"
@@ -14522,17 +14522,17 @@
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v4.4.48",
-            "version_normalized": "4.4.48.0",
+            "version": "v4.4.49",
+            "version_normalized": "4.4.49.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-foundation.git",
-                "reference": "cd4f478e67f7c8776a13b17e7d44241fd66261ad"
+                "reference": "191413c7b832c015bb38eae963f2e57498c3c173"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cd4f478e67f7c8776a13b17e7d44241fd66261ad",
-                "reference": "cd4f478e67f7c8776a13b17e7d44241fd66261ad",
+                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/191413c7b832c015bb38eae963f2e57498c3c173",
+                "reference": "191413c7b832c015bb38eae963f2e57498c3c173",
                 "shasum": ""
             },
             "require": {
@@ -14545,7 +14545,7 @@
                 "predis/predis": "~1.0",
                 "symfony/expression-language": "^3.4|^4.0|^5.0"
             },
-            "time": "2022-10-12T09:40:54+00:00",
+            "time": "2022-11-04T16:17:57+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -14573,7 +14573,7 @@
             "description": "Defines an object-oriented layer for the HTTP specification",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-foundation/tree/v4.4.48"
+                "source": "https://github.com/symfony/http-foundation/tree/v4.4.49"
             },
             "funding": [
                 {
@@ -14593,17 +14593,17 @@
         },
         {
             "name": "symfony/http-kernel",
-            "version": "v4.4.48",
-            "version_normalized": "4.4.48.0",
+            "version": "v4.4.49",
+            "version_normalized": "4.4.49.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-kernel.git",
-                "reference": "a6d5229dd9466e046674baad8449ad92ee24eddd"
+                "reference": "4e36db8103062c62b3882b1bd297b02de6b021c4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a6d5229dd9466e046674baad8449ad92ee24eddd",
-                "reference": "a6d5229dd9466e046674baad8449ad92ee24eddd",
+                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4e36db8103062c62b3882b1bd297b02de6b021c4",
+                "reference": "4e36db8103062c62b3882b1bd297b02de6b021c4",
                 "shasum": ""
             },
             "require": {
@@ -14652,7 +14652,7 @@
                 "symfony/console": "",
                 "symfony/dependency-injection": ""
             },
-            "time": "2022-10-28T16:49:22+00:00",
+            "time": "2022-11-28T17:58:43+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
@@ -14680,7 +14680,7 @@
             "description": "Provides a structured process for converting a Request into a Response",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-kernel/tree/v4.4.48"
+                "source": "https://github.com/symfony/http-kernel/tree/v4.4.49"
             },
             "funding": [
                 {
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index bddb3ca2ac..97f07bd7dd 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
         'name' => 'osu-asc-webservices/d8-upstream',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '429f72e15c8ceea994931b8d1abf14e67c0e8c20',
+        'reference' => 'b32d6543d3f3958296e85fa3c3e6faf263f8a478',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -965,9 +965,9 @@
             'dev_requirement' => false,
         ),
         'drupal/menu_block' => array(
-            'pretty_version' => '1.7.0',
-            'version' => '1.7.0.0',
-            'reference' => '8.x-1.7',
+            'pretty_version' => '1.10.0',
+            'version' => '1.10.0.0',
+            'reference' => '8.x-1.10',
             'type' => 'drupal-module',
             'install_path' => __DIR__ . '/../../web/modules/menu_block',
             'aliases' => array(),
@@ -1594,7 +1594,7 @@
         'osu-asc-webservices/d8-upstream' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '429f72e15c8ceea994931b8d1abf14e67c0e8c20',
+            'reference' => 'b32d6543d3f3958296e85fa3c3e6faf263f8a478',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
@@ -2286,18 +2286,18 @@
             'dev_requirement' => false,
         ),
         'symfony/http-foundation' => array(
-            'pretty_version' => 'v4.4.48',
-            'version' => '4.4.48.0',
-            'reference' => 'cd4f478e67f7c8776a13b17e7d44241fd66261ad',
+            'pretty_version' => 'v4.4.49',
+            'version' => '4.4.49.0',
+            'reference' => '191413c7b832c015bb38eae963f2e57498c3c173',
             'type' => 'library',
             'install_path' => __DIR__ . '/../symfony/http-foundation',
             'aliases' => array(),
             'dev_requirement' => false,
         ),
         'symfony/http-kernel' => array(
-            'pretty_version' => 'v4.4.48',
-            'version' => '4.4.48.0',
-            'reference' => 'a6d5229dd9466e046674baad8449ad92ee24eddd',
+            'pretty_version' => 'v4.4.49',
+            'version' => '4.4.49.0',
+            'reference' => '4e36db8103062c62b3882b1bd297b02de6b021c4',
             'type' => 'library',
             'install_path' => __DIR__ . '/../symfony/http-kernel',
             'aliases' => array(),
diff --git a/vendor/symfony/http-foundation/IpUtils.php b/vendor/symfony/http-foundation/IpUtils.php
index 8f30ee0991..de2112cfc7 100644
--- a/vendor/symfony/http-foundation/IpUtils.php
+++ b/vendor/symfony/http-foundation/IpUtils.php
@@ -124,6 +124,15 @@ public static function checkIp6($requestIp, $ip)
             throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
         }
 
+        // Check to see if we were given a IP4 $requestIp or $ip by mistake
+        if (str_contains($requestIp, '.') || str_contains($ip, '.')) {
+            return self::$checkedIps[$cacheKey] = false;
+        }
+
+        if (!filter_var($requestIp, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
+            return self::$checkedIps[$cacheKey] = false;
+        }
+
         if (str_contains($ip, '/')) {
             [$address, $netmask] = explode('/', $ip, 2);
 
diff --git a/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php b/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php
index 554e1a1602..eb9c26a3b7 100644
--- a/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php
+++ b/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php
@@ -59,7 +59,7 @@ protected function matches($response): bool
             return false;
         }
 
-        return $this->value === $cookie->getValue();
+        return $this->value === (string) $cookie->getValue();
     }
 
     /**
diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php
index d4971cc1a5..48ea6e742d 100644
--- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php
+++ b/vendor/symfony/http-kernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php
@@ -69,8 +69,9 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable
         }
 
         if (!$this->container->has($controller)) {
-            $i = strrpos($controller, ':');
-            $controller = substr($controller, 0, $i).strtolower(substr($controller, $i));
+            $controller = (false !== $i = strrpos($controller, ':'))
+                ? substr($controller, 0, $i).strtolower(substr($controller, $i))
+                : $controller.'::__invoke';
         }
 
         $what = sprintf('argument $%s of "%s()"', $argument->getName(), $controller);
diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php
index 54ea465379..be36bc6346 100644
--- a/vendor/symfony/http-kernel/Kernel.php
+++ b/vendor/symfony/http-kernel/Kernel.php
@@ -76,11 +76,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
 
     private static $freshCache = [];
 
-    public const VERSION = '4.4.48';
-    public const VERSION_ID = 40448;
+    public const VERSION = '4.4.49';
+    public const VERSION_ID = 40449;
     public const MAJOR_VERSION = 4;
     public const MINOR_VERSION = 4;
-    public const RELEASE_VERSION = 48;
+    public const RELEASE_VERSION = 49;
     public const EXTRA_VERSION = '';
 
     public const END_OF_MAINTENANCE = '11/2022';
diff --git a/web/modules/menu_block/README.txt b/web/modules/menu_block/README.txt
index e863865ef6..1d308d59f8 100644
--- a/web/modules/menu_block/README.txt
+++ b/web/modules/menu_block/README.txt
@@ -5,6 +5,15 @@ Like Drupal core, the Menu Block module allows you to create blocks of menu
 items. However, Menu Block's blocks are much more configurable than Drupal
 core's.
 
+INSTALLATION
+------------
+
+You must remove and re-add any existing menu blocks after installing this module.
+
+Currently the module has no effect on existing menu blocks,
+see issue: #2787677: Reconfigure core menu blocks to be menu_block blocks
+https://www.drupal.org/project/menu_block/issues/2787677
+
 
 ADDING MENU BLOCKS
 ------------------
diff --git a/web/modules/menu_block/menu_block.info.yml b/web/modules/menu_block/menu_block.info.yml
index ceb9596a6f..b5d7dafbfd 100644
--- a/web/modules/menu_block/menu_block.info.yml
+++ b/web/modules/menu_block/menu_block.info.yml
@@ -1,11 +1,11 @@
 name: Menu Block
 description: Provides configurable blocks of menu links.
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^9.1 || ^10
 type: module
 dependencies:
   - drupal:menu_ui
 
-# Information added by Drupal.org packaging script on 2021-04-28
-version: '8.x-1.7'
+# Information added by Drupal.org packaging script on 2022-11-03
+version: '8.x-1.10'
 project: 'menu_block'
-datestamp: 1619638240
+datestamp: 1667434257
diff --git a/web/modules/menu_block/menu_block.module b/web/modules/menu_block/menu_block.module
index 43d7b45c83..c579636753 100644
--- a/web/modules/menu_block/menu_block.module
+++ b/web/modules/menu_block/menu_block.module
@@ -125,3 +125,14 @@ function menu_block_preprocess_block(&$variables) {
     $variables['configuration']['label'] = $config_label;
   }
 }
+
+/**
+ * Implements hook_plugin_filter_TYPE__CONSUMER_alter().
+ */
+function menu_block_plugin_filter_block__layout_builder_alter(array &$definitions, array $extra) {
+  foreach ($definitions as $key => $definition) {
+    if ($definition['id'] === 'system_menu_block') {
+      unset($definitions[$key]);
+    }
+  }
+}
diff --git a/web/modules/menu_block/src/EventSubscriber/MenuBlockKernelViewSubscriber.php b/web/modules/menu_block/src/EventSubscriber/MenuBlockKernelViewSubscriber.php
index 633f284a13..8c9ec4187e 100644
--- a/web/modules/menu_block/src/EventSubscriber/MenuBlockKernelViewSubscriber.php
+++ b/web/modules/menu_block/src/EventSubscriber/MenuBlockKernelViewSubscriber.php
@@ -4,7 +4,7 @@
 
 use Drupal\Core\Routing\RouteMatchInterface;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\ViewEvent;
 use Symfony\Component\HttpKernel\KernelEvents;
 
 /**
@@ -35,10 +35,10 @@ public function __construct(RouteMatchInterface $current_route_match) {
   /**
    * Alters the block library modal.
    *
-   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
+   * @param \Symfony\Component\HttpKernel\Event\ViewEvent $event
    *   The event to process.
    */
-  public function onView(GetResponseEvent $event) {
+  public function onView(ViewEvent $event) {
     switch ($this->currentRouteMatch->getRouteName()) {
       case 'block.admin_library':
       case 'context.reaction.blocks.library':
diff --git a/web/modules/menu_block/src/Plugin/Block/MenuBlock.php b/web/modules/menu_block/src/Plugin/Block/MenuBlock.php
index f90485fd64..d36176909f 100644
--- a/web/modules/menu_block/src/Plugin/Block/MenuBlock.php
+++ b/web/modules/menu_block/src/Plugin/Block/MenuBlock.php
@@ -69,6 +69,7 @@ public function blockForm($form, FormStateInterface $form_state) {
     $defaults = $this->defaultConfiguration();
 
     $form = parent::blockForm($form, $form_state);
+    $menu_parent_selector = \Drupal::service('menu.parent_form_selector');
 
     // If there exists a config value for Expand all menu links (expand), that
     // value should populate core's Expand all menu items checkbox
@@ -88,7 +89,7 @@ public function blockForm($form, FormStateInterface $form_state) {
     $menus = Menu::loadMultiple([$menu_name]);
     $menus[$menu_name] = $menus[$menu_name]->label();
 
-    $form['advanced']['parent'] = $this->menuParentFormSelector->parentSelectElement($config['parent'], '', $menus);
+    $form['advanced']['parent'] = $menu_parent_selector->parentSelectElement($config['parent'], '', $menus);
 
     $form['advanced']['parent'] += [
       '#title' => $this->t('Fixed parent item'),
@@ -230,7 +231,7 @@ public function build() {
     // 'expand' config property in case the menu block's configuration has not
     // yet been updated.
     $expand_all_items = $this->configuration['expand'] ?? $this->configuration['expand_all_items'];
-    $parent = $this->configuration['parent'];
+    $parent = $this->configuration['parent'] ?? '';
     $follow = $this->configuration['follow'];
     $follow_parent = $this->configuration['follow_parent'];
     $following = FALSE;
@@ -346,18 +347,9 @@ public function build() {
       'route_parameters' => ['menu' => $menu_name],
     ];
 
-    return $build;
-  }
+    $build['#cache']['contexts'][] = 'route.menu_active_trails:' . $menu_name;
 
-  /**
-   * {@inheritdoc}
-   */
-  public function blockAccess(AccountInterface $account) {
-    $build = $this->build();
-    if (empty($build['#items'])) {
-      return AccessResult::forbidden();
-    }
-    return parent::blockAccess($account);
+    return $build;
   }
 
   /**
@@ -446,6 +438,7 @@ protected function getFixedMenuItemTitle() {
       $fixed_menu_link_id = str_replace($this->getDerivativeId() . ':', '', $parent);
       return $this->getLinkTitleFromLink($fixed_menu_link_id);
     }
+    return NULL;
   }
 
   /**
@@ -460,6 +453,7 @@ protected function getActiveItemTitle() {
     if ($active_trail_ids) {
       return $this->getLinkTitleFromLink(reset($active_trail_ids));
     }
+    return NULL;
   }
 
   /**
@@ -478,6 +472,7 @@ protected function getActiveTrailParentTitle() {
       }
       return $this->getLinkTitleFromLink(next($active_trail_ids));
     }
+    return NULL;
   }
 
   /**
@@ -493,6 +488,7 @@ protected function getActiveTrailRootTitle() {
     if ($active_trail_ids) {
       return $this->getLinkTitleFromLink(end($active_trail_ids));
     }
+    return NULL;
   }
 
   /**
@@ -515,7 +511,7 @@ protected function getDerivativeActiveTrailIds() {
    * @return string|null
    *   The menu item title or NULL if the given menu item can't be found.
    */
-  protected function getLinkTitleFromLink($link_id) {
+  protected function getLinkTitleFromLink(string $link_id) {
     $parameters = new MenuTreeParameters();
     $menu = $this->menuTree->load($this->getDerivativeId(), $parameters);
     $link = $this->findLinkInTree($menu, $link_id);
@@ -526,6 +522,7 @@ protected function getLinkTitleFromLink($link_id) {
       }
       return $link->link->getTitle();
     }
+    return NULL;
   }
 
   /**
@@ -550,6 +547,7 @@ protected function findLinkInTree(array $menu_tree, $link_id) {
         return $link;
       }
     }
+    return NULL;
   }
 
 }
diff --git a/web/modules/menu_block/tests/modules/menu_block_test/menu_block_test.info.yml b/web/modules/menu_block/tests/modules/menu_block_test/menu_block_test.info.yml
index b2f597582c..f5225051ee 100644
--- a/web/modules/menu_block/tests/modules/menu_block_test/menu_block_test.info.yml
+++ b/web/modules/menu_block/tests/modules/menu_block_test/menu_block_test.info.yml
@@ -2,9 +2,9 @@ name: 'Menu block test module'
 type: module
 description: 'Support module for menu_block testing.'
 package: Testing
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
 
-# Information added by Drupal.org packaging script on 2021-04-28
-version: '8.x-1.7'
+# Information added by Drupal.org packaging script on 2022-11-03
+version: '8.x-1.10'
 project: 'menu_block'
-datestamp: 1619638240
+datestamp: 1667434257
diff --git a/web/modules/menu_block/tests/src/Functional/MenuBlockTest.php b/web/modules/menu_block/tests/src/Functional/MenuBlockTest.php
index 8e18c94c3e..bdcaf2e5f6 100644
--- a/web/modules/menu_block/tests/src/Functional/MenuBlockTest.php
+++ b/web/modules/menu_block/tests/src/Functional/MenuBlockTest.php
@@ -15,7 +15,7 @@ class MenuBlockTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = [
+  protected static $modules = [
     'block',
     'menu_block',
     'menu_block_test',
@@ -78,7 +78,7 @@ class MenuBlockTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  public function setUp() {
+  public function setUp(): void {
     parent::setUp();
 
     $this->menuLinkManager = \Drupal::service('plugin.manager.menu.link');
@@ -132,6 +132,7 @@ protected function createLinkHierarchy() {
       'link' => ['uri' => 'internal:/menu-block-test/hierarchy/parent/child-1'],
       'parent' => $links['parent'],
     ];
+    /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $link */
     $link = $this->menuLinkContentStorage->create($child_1);
     $link->save();
     $links['child-1'] = $link->getPluginId();
@@ -141,6 +142,7 @@ protected function createLinkHierarchy() {
       'link' => ['uri' => 'internal:/menu-block-test/hierarchy/parent/child-1/child-1-1'],
       'parent' => $links['child-1'],
     ];
+    /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $link */
     $link = $this->menuLinkContentStorage->create($child_1_1);
     $link->save();
     $links['child-1-1'] = $link->getPluginId();
@@ -150,6 +152,7 @@ protected function createLinkHierarchy() {
       'link' => ['uri' => 'internal:/menu-block-test/hierarchy/parent/child-1/child-1-2'],
       'parent' => $links['child-1'],
     ];
+    /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $link */
     $link = $this->menuLinkContentStorage->create($child_1_2);
     $link->save();
     $links['child-1-2'] = $link->getPluginId();
@@ -159,6 +162,7 @@ protected function createLinkHierarchy() {
       'link' => ['uri' => 'internal:/menu-block-test/hierarchy/parent/child-2'],
       'parent' => $links['parent'],
     ];
+    /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $link */
     $link = $this->menuLinkContentStorage->create($child_2);
     $link->save();
     $links['child-2'] = $link->getPluginId();
@@ -173,7 +177,7 @@ public function testMenuBlockFormDisplay() {
     $this->drupalGet('admin/structure/block/add/menu_block:main');
     $this->assertSession()->pageTextContains('Initial visibility level');
     $this->assertSession()->pageTextContains('Number of levels to display');
-    $this->assertSession()->pageTextContains('Expand all menu items');
+    $this->assertSession()->pageTextContains('Expand all menu links');
     $this->assertSession()->pageTextContains('Fixed parent item');
     $this->assertSession()
       ->pageTextContains('Make the initial visibility level follow the active menu item.');
@@ -199,7 +203,7 @@ public function testMenuBlockUi() {
       'settings[suggestion]' => 'main',
       'region' => 'primary_menu',
     ], 'Save block');
-
+    /** @var \Drupal\block\Entity\Block $block */
     $block = $this->blockStorage->load($block_id);
     $block_settings = $block->get('settings');
     $this->assertSame(2, $block_settings['level']);
-- 
GitLab