From 1c814ad4277296875b9bd1f94c890842375acce7 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Mon, 3 Jun 2024 14:38:30 +0100
Subject: [PATCH] Issue #3451602 by kristiaanvandeneynde: AccessResult::orIf()
 has meaningless checks

---
 core/lib/Drupal/Core/Access/AccessResult.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/lib/Drupal/Core/Access/AccessResult.php b/core/lib/Drupal/Core/Access/AccessResult.php
index ee7d96a68360..4b4be161c7cf 100644
--- a/core/lib/Drupal/Core/Access/AccessResult.php
+++ b/core/lib/Drupal/Core/Access/AccessResult.php
@@ -319,7 +319,7 @@ public function orIf(AccessResultInterface $other) {
     }
     else {
       $result = static::neutral();
-      if (!$this->isNeutral() || ($this->getCacheMaxAge() === 0 && $other->isNeutral()) || ($this->getCacheMaxAge() !== 0 && $other instanceof CacheableDependencyInterface && $other->getCacheMaxAge() !== 0)) {
+      if ($this->getCacheMaxAge() === 0  || ($other instanceof CacheableDependencyInterface && $other->getCacheMaxAge() !== 0)) {
         $merge_other = TRUE;
       }
 
-- 
GitLab