From 5b61b76076b71bd09b6d801d9e4682d8824f381c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 2 Nov 2020 09:14:27 +0100 Subject: [PATCH] ExtensibleSetElement: failsafe rendering --- .../Web/Form/IplElement/ExtensibleSetElement.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/library/Director/Web/Form/IplElement/ExtensibleSetElement.php b/library/Director/Web/Form/IplElement/ExtensibleSetElement.php index 7f1ffeaf..a4dbb207 100644 --- a/library/Director/Web/Form/IplElement/ExtensibleSetElement.php +++ b/library/Director/Web/Form/IplElement/ExtensibleSetElement.php @@ -305,17 +305,29 @@ class ExtensibleSetElement extends BaseHtmlElement if ($this->inheritedFrom === null) { return \sprintf( $this->translate('%s (inherited)'), - \implode(', ', $this->inherited) + $this->stringifyInheritedValue() ); } else { return \sprintf( $this->translate('%s (inherited from %s)'), - \implode(', ', $this->inherited), + $this->stringifyInheritedValue(), $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() { return $this->newInlineButtons(