ExtensibleSetElement: failsafe rendering

This commit is contained in:
Thomas Gelf 2020-11-02 09:14:27 +01:00
parent 685e42d325
commit 5b61b76076

View File

@ -305,17 +305,29 @@ class ExtensibleSetElement extends BaseHtmlElement
if ($this->inheritedFrom === null) { if ($this->inheritedFrom === null) {
return \sprintf( return \sprintf(
$this->translate('%s (inherited)'), $this->translate('%s (inherited)'),
\implode(', ', $this->inherited) $this->stringifyInheritedValue()
); );
} else { } else {
return \sprintf( return \sprintf(
$this->translate('%s (inherited from %s)'), $this->translate('%s (inherited from %s)'),
\implode(', ', $this->inherited), $this->stringifyInheritedValue(),
$this->inheritedFrom $this->inheritedFrom
); );
} }
} }
private function stringifyInheritedValue()
{
if (\is_array($this->inherited)) {
return \implode(', ', $this->inherited);
} else {
return \sprintf(
$this->translate('%s (not an Array!)'),
\var_export($this->inherited, 1)
);
}
}
private function createAddNewButton() private function createAddNewButton()
{ {
return $this->newInlineButtons( return $this->newInlineButtons(