do not pass parent folder to hook add[Folder|Document]Attribute

This commit is contained in:
Uwe Steinmann 2020-08-28 07:39:16 +02:00
parent bcf7d2f2d8
commit 619f90b4df
2 changed files with 10 additions and 2 deletions

View File

@ -322,7 +322,7 @@ $(document).ready(function() {
} }
} }
} }
$arrs = $this->callHook('addDocumentAttributes', $folder); $arrs = $this->callHook('addDocumentAttributes', null);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1]);

View File

@ -109,6 +109,10 @@ $(document).ready( function() {
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all)); $attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
if($attrdefs) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
/* The second parameter is null, to make this function call equal
* to 'editFolderAttribute', which expects the folder as the second
* parameter.
*/
$arr = $this->callHook('addFolderAttribute', null, $attrdef); $arr = $this->callHook('addFolderAttribute', null, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) { if($arr) {
@ -119,7 +123,11 @@ $(document).ready( function() {
} }
} }
} }
$arrs = $this->callHook('addFolderAttributes', $folder); /* The second parameter is null, to make this function call equal
* to 'editFolderAttributes', which expects the folder as the second
* parameter.
*/
$arrs = $this->callHook('addFolderAttributes', null);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1]);