From b54a659de1414e9778b4a746220aed1181c68c31 Mon Sep 17 00:00:00 2001 From: Dries <dries@buytaert.net> Date: Mon, 7 Jan 2013 21:21:40 -0500 Subject: [PATCH] Issue #1880926 by plach: Fixed Fatal error when retrieving ->original on a BC entity. --- core/lib/Drupal/Core/Entity/EntityBCDecorator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/EntityBCDecorator.php b/core/lib/Drupal/Core/Entity/EntityBCDecorator.php index b577c1842196..8f5e5217151c 100644 --- a/core/lib/Drupal/Core/Entity/EntityBCDecorator.php +++ b/core/lib/Drupal/Core/Entity/EntityBCDecorator.php @@ -75,8 +75,10 @@ public function &__get($name) { // Allow accessing field values in entity default languages other than // LANGUAGE_DEFAULT by mapping the values to LANGUAGE_DEFAULT. $langcode = $this->decorated->language()->langcode; - if ($langcode != LANGUAGE_DEFAULT && isset($this->decorated->values[$name][LANGUAGE_DEFAULT]) && !isset($this->decorated->values[$name][$langcode])) { - $this->decorated->values[$name][$langcode] = &$this->decorated->values[$name][LANGUAGE_DEFAULT]; + if ($langcode != LANGUAGE_DEFAULT && isset($this->decorated->values[$name]) && is_array($this->decorated->values[$name])) { + if (isset($this->decorated->values[$name][LANGUAGE_DEFAULT]) && !isset($this->decorated->values[$name][$langcode])) { + $this->decorated->values[$name][$langcode] = &$this->decorated->values[$name][LANGUAGE_DEFAULT]; + } } if (!isset($this->decorated->values[$name])) { -- GitLab