fix php warning in getAttributeEditField()

This commit is contained in:
Uwe Steinmann 2022-03-04 08:27:17 +01:00
parent 4d0b9a6511
commit 1c4fbbed96
2 changed files with 4 additions and 4 deletions

View File

@ -1811,7 +1811,7 @@ $(document).ready(function() {
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), $target, $fieldname."[".$attrdef->getId()."]");
break;
case SeedDMS_Core_AttributeDefinition::type_user:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
$users = $dms->getAllUsers();
if($users) {
$allowempty = $attrdef->getMinValues() == 0;
@ -1831,7 +1831,7 @@ $(document).ready(function() {
}
break;
case SeedDMS_Core_AttributeDefinition::type_group:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
$groups = $dms->getAllGroups();
if($groups) {
$allowempty = $attrdef->getMinValues() == 0;

View File

@ -1856,7 +1856,7 @@ $(document).ready(function() {
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), $target, $fieldname."[".$attrdef->getId()."]");
break;
case SeedDMS_Core_AttributeDefinition::type_user:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
$users = $dms->getAllUsers();
if($users) {
$allowempty = $attrdef->getMinValues() == 0;
@ -1876,7 +1876,7 @@ $(document).ready(function() {
}
break;
case SeedDMS_Core_AttributeDefinition::type_group:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
$groups = $dms->getAllGroups();
if($groups) {
$allowempty = $attrdef->getMinValues() == 0;