From 09a0323ad6b387fd460a667ab88ab70812b1322b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 11 Mar 2021 23:45:54 +0100 Subject: [PATCH] DirectorObjectForm: render inherited scalars only fixes #2288 --- doc/82-Changelog.md | 1 + library/Director/Web/Form/DirectorObjectForm.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index fb0564f8..08e1b126 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -26,6 +26,7 @@ next patch release (will be 1.8.1) ### User Interface * FIX: don't fail when showing a Host overriding multiple inherited groups (#2253) +* FIX: deal with inherited values which are invalid for a select box (#2288) ### Automation, User Interface * FIX: error message wording on failing related (or parent) object ref (#2224) diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php index fd8e0a6f..23bf7eb7 100644 --- a/library/Director/Web/Form/DirectorObjectForm.php +++ b/library/Director/Web/Form/DirectorObjectForm.php @@ -629,7 +629,7 @@ abstract class DirectorObjectForm extends DirectorForm if (is_bool($inherited)) { $inherited = $inherited ? 'y' : 'n'; } - if (array_key_exists($inherited, $multi)) { + if (is_scalar($inherited) && array_key_exists($inherited, $multi)) { $multi[null] = $multi[$inherited] . sprintf($txtInherited, $inheritedFrom); } else { $multi[null] = $this->translate($this->translate('- inherited -'));