From d2b27a0bdeef857ddd809366650793a6bf18ecbc Mon Sep 17 00:00:00 2001
From: Brian Canini <canini.16@osu.edu>
Date: Thu, 23 Apr 2020 11:17:24 -0400
Subject: [PATCH] Updating drupal/rebuild_cache_access (1.4.0 => 1.6.0)

---
 composer.json                                  |  4 ++--
 composer.lock                                  | 18 +++++++++---------
 vendor/composer/installed.json                 | 18 +++++++++---------
 web/modules/rebuild_cache_access/README.md     |  2 +-
 .../rebuild_cache_access.info.yml              | 11 +++++------
 .../rebuild_cache_access.module                |  3 ++-
 .../RebuildCacheAccessController.php           | 11 +++++++++--
 .../src/ToolbarHandler.php                     | 18 +-----------------
 .../tests/src/Functional/ToolbarTest.php       |  1 +
 9 files changed, 39 insertions(+), 47 deletions(-)

diff --git a/composer.json b/composer.json
index 1e4a9ed879..e2306c6059 100644
--- a/composer.json
+++ b/composer.json
@@ -151,7 +151,7 @@
         "drupal/paragraphs": "1.11",
         "drupal/pathauto": "1.6",
         "drupal/realname": "1.0.0-rc2",
-        "drupal/rebuild_cache_access": "1.4",
+        "drupal/rebuild_cache_access": "1.6",
         "drupal/recaptcha": "2.4",
         "drupal/redirect": "1.3",
         "drupal/redis": "1.0",
@@ -321,4 +321,4 @@
             "php": "7.0.8"
         }
     }
-}
\ No newline at end of file
+}
diff --git a/composer.lock b/composer.lock
index 903eebe490..ef69d35429 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": "a5b57e165ccb78ef450729502b4e2962",
+    "content-hash": "1ee1f9d1f601742971a8f3b556ac880a",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -6686,20 +6686,20 @@
         },
         {
             "name": "drupal/rebuild_cache_access",
-            "version": "1.4.0",
+            "version": "1.6.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/rebuild_cache_access.git",
-                "reference": "8.x-1.4"
+                "reference": "8.x-1.6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/rebuild_cache_access-8.x-1.4.zip",
-                "reference": "8.x-1.4",
-                "shasum": "31766f60f6f7dfeb29001f4532d457cfb6cbb3dd"
+                "url": "https://ftp.drupal.org/files/projects/rebuild_cache_access-8.x-1.6.zip",
+                "reference": "8.x-1.6",
+                "shasum": "5b53b5550ebdf253cba4d02d4ab8d39c36c8a624"
             },
             "require": {
-                "drupal/core": "*"
+                "drupal/core": "^8 || ^9"
             },
             "type": "drupal-module",
             "extra": {
@@ -6707,8 +6707,8 @@
                     "dev-1.x": "1.x-dev"
                 },
                 "drupal": {
-                    "version": "8.x-1.4",
-                    "datestamp": "1523998080",
+                    "version": "8.x-1.6",
+                    "datestamp": "1576265880",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index eff327b679..52ad9e9754 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -6889,21 +6889,21 @@
     },
     {
         "name": "drupal/rebuild_cache_access",
-        "version": "1.4.0",
-        "version_normalized": "1.4.0.0",
+        "version": "1.6.0",
+        "version_normalized": "1.6.0.0",
         "source": {
             "type": "git",
             "url": "https://git.drupalcode.org/project/rebuild_cache_access.git",
-            "reference": "8.x-1.4"
+            "reference": "8.x-1.6"
         },
         "dist": {
             "type": "zip",
-            "url": "https://ftp.drupal.org/files/projects/rebuild_cache_access-8.x-1.4.zip",
-            "reference": "8.x-1.4",
-            "shasum": "31766f60f6f7dfeb29001f4532d457cfb6cbb3dd"
+            "url": "https://ftp.drupal.org/files/projects/rebuild_cache_access-8.x-1.6.zip",
+            "reference": "8.x-1.6",
+            "shasum": "5b53b5550ebdf253cba4d02d4ab8d39c36c8a624"
         },
         "require": {
-            "drupal/core": "*"
+            "drupal/core": "^8 || ^9"
         },
         "type": "drupal-module",
         "extra": {
@@ -6911,8 +6911,8 @@
                 "dev-1.x": "1.x-dev"
             },
             "drupal": {
-                "version": "8.x-1.4",
-                "datestamp": "1523998080",
+                "version": "8.x-1.6",
+                "datestamp": "1576265880",
                 "security-coverage": {
                     "status": "covered",
                     "message": "Covered by Drupal's security advisory policy"
diff --git a/web/modules/rebuild_cache_access/README.md b/web/modules/rebuild_cache_access/README.md
index a902bd502a..9a5bfc17e0 100644
--- a/web/modules/rebuild_cache_access/README.md
+++ b/web/modules/rebuild_cache_access/README.md
@@ -1,6 +1,6 @@
 # Rebuild Cache Access
 
-https://www.drupal.org/project/rebuild_cache_access
+`composer require drupal/rebuild_cache_access`
 
 This module provides a new permission: `rebuild cache access`. Every role with
 this permission set will have a nice and big Rebuild Cache admin toolbar button.
diff --git a/web/modules/rebuild_cache_access/rebuild_cache_access.info.yml b/web/modules/rebuild_cache_access/rebuild_cache_access.info.yml
index 376cba5252..18d6d32881 100644
--- a/web/modules/rebuild_cache_access/rebuild_cache_access.info.yml
+++ b/web/modules/rebuild_cache_access/rebuild_cache_access.info.yml
@@ -3,13 +3,12 @@ description: Provide a Rebuild Cache admin toolbar button accessible to every ro
 package: Utility
 
 type: module
-# core: 8.x
-
+core: 8.x
+core_version_requirement: ^8 || ^9
 dependencies:
   - drupal:toolbar
 
-# Information added by Drupal.org packaging script on 2018-04-17
-version: '8.x-1.4'
-core: '8.x'
+# Information added by Drupal.org packaging script on 2019-12-13
+version: '8.x-1.6'
 project: 'rebuild_cache_access'
-datestamp: 1523998084
+datestamp: 1576265885
diff --git a/web/modules/rebuild_cache_access/rebuild_cache_access.module b/web/modules/rebuild_cache_access/rebuild_cache_access.module
index e35a566097..b54b627440 100644
--- a/web/modules/rebuild_cache_access/rebuild_cache_access.module
+++ b/web/modules/rebuild_cache_access/rebuild_cache_access.module
@@ -5,6 +5,7 @@
  * This module adds a 'Rebuild Cache' permission and button to the toolbar.
  */
 
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\rebuild_cache_access\ToolbarHandler;
 
 /**
@@ -20,7 +21,7 @@ function rebuild_cache_access_toolbar() {
 /**
  * Implements hook_help().
  */
-function rebuild_cache_access_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) {
+function rebuild_cache_access_help($route_name, RouteMatchInterface $route_match) {
 
   switch ($route_name) {
     case 'help.page.rebuild_cache_access':
diff --git a/web/modules/rebuild_cache_access/src/Controller/RebuildCacheAccessController.php b/web/modules/rebuild_cache_access/src/Controller/RebuildCacheAccessController.php
index fb0d9e32fc..1a2e8ff1be 100644
--- a/web/modules/rebuild_cache_access/src/Controller/RebuildCacheAccessController.php
+++ b/web/modules/rebuild_cache_access/src/Controller/RebuildCacheAccessController.php
@@ -4,14 +4,21 @@
 
 use Drupal\Core\Controller\ControllerBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RequestStack;
 use Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Returns responses for rebuild_cache_access module routes.
  */
 class RebuildCacheAccessController extends ControllerBase {
 
+  /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
   /**
    * {@inheritdoc}
    */
@@ -46,7 +53,7 @@ public function reloadPage() {
    */
   public function rebuildCache() {
     drupal_flush_all_caches();
-    drupal_set_message($this->t('All caches cleared.'));
+    $this->messenger()->addMessage($this->t('All caches cleared.'));
     return new RedirectResponse($this->reloadPage());
   }
 
diff --git a/web/modules/rebuild_cache_access/src/ToolbarHandler.php b/web/modules/rebuild_cache_access/src/ToolbarHandler.php
index 550bfc6cf3..646913b09e 100644
--- a/web/modules/rebuild_cache_access/src/ToolbarHandler.php
+++ b/web/modules/rebuild_cache_access/src/ToolbarHandler.php
@@ -2,9 +2,7 @@
 
 namespace Drupal\rebuild_cache_access;
 
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Menu\MenuLinkTreeInterface;
 use Drupal\Core\Session\AccountProxyInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\Url;
@@ -17,13 +15,6 @@ class ToolbarHandler implements ContainerInjectionInterface {
 
   use StringTranslationTrait;
 
-  /**
-   * The menu link tree service.
-   *
-   * @var \Drupal\Core\Menu\MenuLinkTreeInterface
-   */
-  protected $menuLinkTree;
-
   /**
    * The current user.
    *
@@ -34,15 +25,10 @@ class ToolbarHandler implements ContainerInjectionInterface {
   /**
    * ToolbarHandler constructor.
    *
-   * @param \Drupal\Core\Menu\MenuLinkTreeInterface $menu_link_tree
-   *   The menu link tree service.
-   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
-   *   The config factory.
    * @param \Drupal\Core\Session\AccountProxyInterface $account
    *   The current user.
    */
-  public function __construct(MenuLinkTreeInterface $menu_link_tree, ConfigFactoryInterface $config_factory, AccountProxyInterface $account) {
-    $this->menuLinkTree = $menu_link_tree;
+  public function __construct(AccountProxyInterface $account) {
     $this->account      = $account;
   }
 
@@ -51,8 +37,6 @@ public function __construct(MenuLinkTreeInterface $menu_link_tree, ConfigFactory
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('toolbar.menu_tree'),
-      $container->get('config.factory'),
       $container->get('current_user')
     );
   }
diff --git a/web/modules/rebuild_cache_access/tests/src/Functional/ToolbarTest.php b/web/modules/rebuild_cache_access/tests/src/Functional/ToolbarTest.php
index 9896beffe6..9e8a700625 100644
--- a/web/modules/rebuild_cache_access/tests/src/Functional/ToolbarTest.php
+++ b/web/modules/rebuild_cache_access/tests/src/Functional/ToolbarTest.php
@@ -63,4 +63,5 @@ public function testButton() {
     $this->clickLink('Rebuild Cache');
     $this->assertSession()->pageTextContains('All caches cleared.');
   }
+
 }
-- 
GitLab