Commit 820cb169 authored by corvus_ch's avatar corvus_ch Committed by fago

Issue #1796110 by corvus_ch, axel.rutz, berdir, fago: Fixed Rendered entity...

Issue #1796110 by corvus_ch, axel.rutz, berdir, fago: Fixed Rendered entity fields show same result when multiple relationships are in use.
parent 3f1741ac
......@@ -323,29 +323,29 @@ class EntityFieldHandlerHelper {
if (!isset($values->_entity_properties)) {
$values->_entity_properties = array();
}
if (!array_key_exists($selector, $values->_entity_properties)) {
if (!isset($values->_entity_properties[$handler->relationship]) || !array_key_exists($selector, $values->_entity_properties[$handler->relationship])) {
if (!isset($handler->wrappers[$handler->view->row_index])) {
$values->_entity_properties[$selector] = $default;
$values->_entity_properties[$handler->relationship][$selector] = $default;
}
elseif (is_array($handler->wrappers[$handler->view->row_index])) {
$values->_entity_properties[$selector] = self::extract_list_wrapper_values($handler->wrappers[$handler->view->row_index], $field);
$values->_entity_properties[$handler->relationship][$selector] = self::extract_list_wrapper_values($handler->wrappers[$handler->view->row_index], $field);
}
else {
$wrapper = $handler->wrappers[$handler->view->row_index];
try {
if ($field === 'entity object') {
$values->_entity_properties[$selector] = $wrapper->value();
$values->_entity_properties[$handler->relationship][$selector] = $wrapper->value();
}
else {
$values->_entity_properties[$selector] = isset($wrapper->$field) ? $wrapper->$field->value(array('identifier' => TRUE)) : $default;
$values->_entity_properties[$handler->relationship][$selector] = isset($wrapper->$field) ? $wrapper->$field->value(array('identifier' => TRUE)) : $default;
}
}
catch (EntityMetadataWrapperException $e) {
$values->_entity_properties[$selector] = $default;
$values->_entity_properties[$handler->relationship][$selector] = $default;
}
}
}
return $values->_entity_properties[$selector];
return $values->_entity_properties[$handler->relationship][$selector];
}
/**
......
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