TemplateTree: do not remove parents matching the

...objects name from the tree

fixes #1602
This commit is contained in:
Thomas Gelf 2018-08-14 00:29:42 +02:00
parent 457cdb53c1
commit d7c92a29bd
1 changed files with 9 additions and 1 deletions

View File

@ -162,7 +162,15 @@ class TemplateTree
// Hint: inheritance order matters
if (false !== ($key = array_search($name, $ancestors))) {
unset($ancestors[$key]);
// Note: this used to be just unset($ancestors[$key]), and that
// broke Apply Rules inheriting from Templates with the same name
// in a way that related fields no longer showed up (#1602)
// This new if relaxes this and doesn't unset in case the name
// matches the original object name. However, I'm still unsure why
// this was required at all.
if ($name !== $object->getObjectName()) {
unset($ancestors[$key]);
}
}
$ancestors[$pid] = $name;
}