TemplateTree: do not remove parents matching the
...objects name from the tree fixes #1602
This commit is contained in:
parent
457cdb53c1
commit
d7c92a29bd
|
@ -162,8 +162,16 @@ class TemplateTree
|
||||||
|
|
||||||
// Hint: inheritance order matters
|
// Hint: inheritance order matters
|
||||||
if (false !== ($key = array_search($name, $ancestors))) {
|
if (false !== ($key = array_search($name, $ancestors))) {
|
||||||
|
// 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]);
|
unset($ancestors[$key]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$ancestors[$pid] = $name;
|
$ancestors[$pid] = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue