Updated patch for Drupal 10
Updated patch for
Drupal Version
10.2.5
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/modules/views/src/Plugin/views/query/Sql.php
index 47f229f9..1e8e4da6 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -1707,7 +1707,9 @@ class Sql extends QueryPluginBase {
public function getCacheMaxAge() {
$max_age = parent::getCacheMaxAge();
foreach ($this->getAllEntities() as $entity) {
- $max_age = Cache::mergeMaxAges($max_age, $entity->getCacheMaxAge());
+ if(!is_null($entity)){
+ $max_age = Cache::mergeMaxAges($max_age, $entity->getCacheMaxAge());
+ }
}
return $max_age;