N°7063 - Forms SDK - Add Symfony forms component

error forms issue
This commit is contained in:
Benjamin Dalsass
2024-01-15 11:40:52 +01:00
parent 7963690a10
commit 816ab41e27
5 changed files with 21 additions and 4 deletions

View File

@@ -89,11 +89,13 @@ final class FormFactoryObjectAdapter implements FormFactoryAdapterInterface
{
$aOptions = [];
// compute label
$sLabel = $oAttributeDefinition->GetLabel();
if(!$this->bGroup){
$sLabel = $this->GetLabel() . ' ••• ' . $sLabel;
}
// attribute options
if($oAttributeDefinition instanceof AttributeString) {
$aOptions['required'] = !$oAttributeDefinition->IsNullAllowed();
$aOptions['label'] = $sLabel;
@@ -112,8 +114,10 @@ final class FormFactoryObjectAdapter implements FormFactoryAdapterInterface
*/
private function GetAttributeDescription(string $sAttributeCode) : ?FormFieldDescription
{
// retrieve attribute definition
$oAttributeDefinition = MetaModel::GetAttributeDef(get_class($this->oDBObject), $sAttributeCode);
// create field description
if($oAttributeDefinition instanceof AttributeString) {
return new FormFieldDescription(
$this->GetAttributeName($sAttributeCode),