From 3d1996560a1ca626b1fa81fbff4cdceac0e3ac03 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen.haas@lakedrops.com>
Date: Fri, 14 Jun 2024 13:25:26 +0200
Subject: [PATCH] Update patches for Drupal 11

---
 patches/d10/3319445.diff | 41 ++++++++++++++++++++++++++++++++++++++++
 patches/d11.json         |  9 +++++----
 2 files changed, 46 insertions(+), 4 deletions(-)
 create mode 100644 patches/d10/3319445.diff

diff --git a/patches/d10/3319445.diff b/patches/d10/3319445.diff
new file mode 100644
index 0000000..01fd19e
--- /dev/null
+++ b/patches/d10/3319445.diff
@@ -0,0 +1,41 @@
+diff --git a/gin_toolbar.module b/gin_toolbar.module
+index 3fb44b40c1c3c977775637bad7d9fda8beeb90c3..86e65051a9b6c791573100acb3d743c84042cdbe 100644
+--- a/gin_toolbar.module
++++ b/gin_toolbar.module
+@@ -8,6 +8,7 @@
+ use Drupal\Component\Utility\Html;
+ use Drupal\Core\Entity\EntityInterface;
+ use Drupal\Core\Routing\RouteMatchInterface;
++use Drupal\Core\Url;
+ use Drupal\gin\GinNavigation;
+ use Drupal\gin\GinSettings;
+ use Drupal\gin\GinUserPicture;
+@@ -212,8 +213,13 @@ function gin_toolbar_preprocess_toolbar(&$variables) {
+     $entity = \Drupal::request()->attributes->get($matches['entity_type_id']);
+ 
+     if ($entity instanceof EntityInterface && $entity->hasLinkTemplate('edit-form')) {
+-      $variables['entity_title'] = $entity->label();
+-      $variables['entity_edit_url'] = $entity->toUrl('edit-form');
++      if ($entity->access('update')) {
++        $variables['entity_title'] = $entity->label();
++        $variables['entity_edit_url'] = $entity->toUrl('edit-form');
++      }
++      elseif (Url::fromRoute('system.admin_content')->access(\Drupal::currentUser())) {
++        $variables['access_admin_content'] = TRUE;
++      }
+     }
+   }
+ }
+diff --git a/templates/toolbar.html.twig b/templates/toolbar.html.twig
+index f050f4d1c354fef8a9726c8164d0ae45579b1cc5..758cedbcc9fe8aa347b3390c063f1881c3014c10 100644
+--- a/templates/toolbar.html.twig
++++ b/templates/toolbar.html.twig
+@@ -16,7 +16,7 @@
+             <li class="gin-breadcrumb__item">
+               {% if entity_edit_url and entity_title %}
+                 <a class="gin-breadcrumb__link gin-back-to-admin" href="{{ entity_edit_url }}">{{ 'Edit %title'|t({ '%title': entity_title }) }}</a>
+-              {% else %}
++              {% elseif access_admin_content %}
+                 <a class="gin-breadcrumb__link gin-back-to-admin" href="{{ path('system.admin_content') }}">{{ 'Back to Administration'|t }}</a>
+               {% endif %}
+             </li>
diff --git a/patches/d11.json b/patches/d11.json
index c6d14d8..61ba9e3 100644
--- a/patches/d11.json
+++ b/patches/d11.json
@@ -14,6 +14,10 @@
       "#3173340 Exception": "https://www.drupal.org/files/issues/2020-09-26/3173340-2.background_image.Error-Call-to-a-member-function-hasEntityToken-on-bool-in-DrupalbackgroundimageCacheContextBackgroundImageSettingsTextCacheContextgetContext.patch",
       "#3128542 FileScan": "https://www.drupal.org/files/issues/2020-09-11/background_image-missing_folder-3128542-8.patch"
     },
+    "drupal/book-book": {
+      "#2918537 Save unpublished versions of published content without manage book privileges": "https://www.drupal.org/files/issues/2022-12-14/2918537-92.patch",
+      "#3090234 Broken node theming for book export": "https://www.drupal.org/files/issues/2020-10-06/3090234-9.patch"
+    },
     "drupal/bootstrap_clean_blog": {
       "#3146287 Drupal 9": "https://www.drupal.org/files/issues/2021-10-23/3146287_3.patch"
     },
@@ -68,9 +72,7 @@
       "#3302450 Views field default type": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3302450.diff",
       "#3311849 Views exposed filter, empty sections": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3311849.diff",
       "#2797583 Actions for content moderation": "https://www.drupal.org/files/issues/2022-09-20/core-provide-moderation-states-as-actions-2797583-207.patch",
-      "#2918537 Save unpublished versions of published content without manage book privileges": "https://www.drupal.org/files/issues/2022-12-14/2918537-92.patch",
       "#3194462 Big pipe explode issue": "https://www.drupal.org/files/issues/2023-02-28/3194462-30.patch",
-      "#3090234 Broken node theming for book export": "https://www.drupal.org/files/issues/2020-10-06/3090234-9.patch",
       "#3346430 DoPreSave load revision": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3346430.diff",
       "#3340973 Media Lib type error on array_filter": "https://www.drupal.org/files/issues/2023-02-10/fix_media_library_php_error-3340973-2.patch",
       "#3073822 Error: Call to a member function access() on null in Drupal\\comment\\CommentAccessControlHandler->checkAccess()": "https://www.drupal.org/files/issues/2023-01-12/3073822-12.patch",
@@ -131,7 +133,7 @@
       "#3084395 Daterange basefield": "https://www.drupal.org/files/issues/2022-03-25/3084395-11.patch"
     },
     "drupal/gin_toolbar": {
-      "#3319445 Permission check": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/gin_toolbar-permissions.patch"
+      "#3319445 Permission check": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/3319445.diff"
     },
     "drupal/glossify": {
       "#3360633 HTML entities": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3360633.diff"
@@ -215,7 +217,6 @@
       "#3432768 Type casting": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3432768.diff"
     },
     "drupal/tamper": {
-      "#3279973 WordCount plugin": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3279973.diff",
       "#3268276 Timezone plugin": "https://www.drupal.org/files/issues/2023-04-06/0001-Issue-3268276-Reworking-timezones.patch"
     },
     "drupal/taxonomy_machine_name": {
-- 
GitLab