From 40dee4b9d2f9b8910bc71899597134c8cc570187 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 23 Oct 2019 09:05:04 +0200 Subject: [PATCH] hook addDocumentContentAttribute and addDocumentAttribute may return a string --- views/bootstrap/class.AddDocument.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/views/bootstrap/class.AddDocument.php b/views/bootstrap/class.AddDocument.php index 7d4c25ee9..156ba0904 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -285,6 +285,8 @@ $(document).ready(function() { if($arr) { $this->formField($arr[0], $arr[1]); } + } elseif(is_string($arr)) { + echo $arr; } else { $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, '')); } @@ -342,6 +344,8 @@ $(document).ready(function() { $arr = $this->callHook('addDocumentContentAttribute', null, $attrdef); if(is_array($arr)) { $this->formField($arr[0], $arr[1]); + } elseif(is_string($arr)) { + echo $arr; } else { $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, '', 'attributes_version')); }