Commit b54a659d authored by Dries's avatar Dries
Browse files

Issue #1880926 by plach: Fixed Fatal error when retrieving ->original on a BC entity.

parent b11bacd8
......@@ -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])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment