From 24458ab6481f938f24cbcd85ac0a423ca9aabd90 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 21 Jul 2020 07:28:15 +0200 Subject: [PATCH 1/4] check if return value of hook for adding attributes is 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 422f1fbb2..a90011fd4 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -327,6 +327,8 @@ $(document).ready(function() { foreach($arrs as $arr) { $this->formField($arr[0], $arr[1]); } + } elseif(is_string($arrs)) { + echo $arrs; } $this->contentSubHeading(getMLText("version_info")); @@ -391,6 +393,8 @@ $(document).ready(function() { foreach($arrs as $arr) { $this->formField($arr[0], $arr[1]); } + } elseif(is_string($arrs)) { + echo $arrs; } if($workflowmode == 'advanced') { From dc6ec3c5c709d308d69a3e59bc8a37fb125d1516 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 21 Jul 2020 07:28:46 +0200 Subject: [PATCH 2/4] add hook addFolderAttributes --- views/bootstrap/class.AddSubFolder.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/views/bootstrap/class.AddSubFolder.php b/views/bootstrap/class.AddSubFolder.php index 52048d3cd..158644a91 100644 --- a/views/bootstrap/class.AddSubFolder.php +++ b/views/bootstrap/class.AddSubFolder.php @@ -119,6 +119,15 @@ $(document).ready( function() { } } } + $arrs = $this->callHook('addFolderAttributes', $folder); + if(is_array($arrs)) { + foreach($arrs as $arr) { + $this->formField($arr[0], $arr[1]); + } + } elseif(is_string($arrs)) { + echo $arrs; + } + $this->formSubmit(" ".getMLText('add_subfolder')); ?> From 55f5fe4047db92de59a8ff02e7bf7ce10a116b6a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 21 Jul 2020 07:29:15 +0200 Subject: [PATCH 3/4] hook addDocumentContentAttributes can return a string --- views/bootstrap/class.UpdateDocument.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/views/bootstrap/class.UpdateDocument.php b/views/bootstrap/class.UpdateDocument.php index eb85944b2..43e396a3c 100644 --- a/views/bootstrap/class.UpdateDocument.php +++ b/views/bootstrap/class.UpdateDocument.php @@ -307,6 +307,8 @@ console.log(element); foreach($arrs as $arr) { $this->formField($arr[0], $arr[1]); } + } elseif(is_string($arrs)) { + echo $arrs; } if($workflowmode == 'advanced') { From e94631bbde1eae25437edd8fcec035adf0c07666 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 21 Jul 2020 07:29:53 +0200 Subject: [PATCH 4/4] propperly check for return value of addXXXAttributes --- views/bootstrap/class.EditAttributes.php | 4 ++-- views/bootstrap/class.EditDocument.php | 4 ++-- views/bootstrap/class.EditFolder.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/views/bootstrap/class.EditAttributes.php b/views/bootstrap/class.EditAttributes.php index ca64c9b98..83616a1b3 100644 --- a/views/bootstrap/class.EditAttributes.php +++ b/views/bootstrap/class.EditAttributes.php @@ -72,8 +72,8 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Bootstrap_Style { foreach($arrs as $arr) { $this->formField($arr[0], $arr[1]); } - } elseif(is_string($arr)) { - echo $arr; + } elseif(is_string($arrs)) { + echo $arrs; } $this->formSubmit(" ".getMLText('save')); ?> diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index c0a6977ca..31f281d15 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -228,8 +228,8 @@ $(document).ready( function() { foreach($arrs as $arr) { $this->formField($arr[0], $arr[1]); } - } elseif(is_string($arr)) { - echo $arr; + } elseif(is_string($arrs)) { + echo $arrs; } $this->formSubmit(" ".getMLText('save')); ?> diff --git a/views/bootstrap/class.EditFolder.php b/views/bootstrap/class.EditFolder.php index 5e99be9ae..59c2ac858 100644 --- a/views/bootstrap/class.EditFolder.php +++ b/views/bootstrap/class.EditFolder.php @@ -130,7 +130,7 @@ $(document).ready(function() { $this->formField($arr[0], $arr[1]); } } elseif(is_string($arrs)) { - echo $arr; + echo $arrs; } $this->formSubmit(" ".getMLText('save')); ?>