From 26684ff047244ea6bf46df1f2a32c977c76ee1fc Mon Sep 17 00:00:00 2001 From: catch <6915-catch@users.noreply.drupalcode.org> Date: Fri, 19 Jul 2024 15:25:05 +0900 Subject: [PATCH] Issue #3460513 by nishtha.pradhan, Berdir: Avoid TypeError if config entity dependencies are NULL --- core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index af81e25bbf2c..c008feaea870 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -376,7 +376,7 @@ public function __sleep(): array { public function calculateDependencies() { // All dependencies should be recalculated on every save apart from enforced // dependencies. This ensures stale dependencies are never saved. - $this->dependencies = array_intersect_key($this->dependencies, ['enforced' => '']); + $this->dependencies = array_intersect_key($this->dependencies ?? [], ['enforced' => '']); if ($this instanceof EntityWithPluginCollectionInterface) { // Configuration entities need to depend on the providers of any plugins // that they store the configuration for. -- GitLab