Skip to content

Commit 8d08979

Browse files
committed
Default unknown field types to "input"
1 parent 472d6a5 commit 8d08979

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Form/Field/Field.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public function getSortOrder(): int
8383

8484
public function isVisible(): bool
8585
{
86-
return (bool)$this->getData('visible');
86+
$visible = $this->getData('visible');
87+
if (is_bool($visible)) {
88+
return $visible;
89+
}
90+
91+
return true;
8792
}
8893
}

Form/FieldResolver.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public function resolve(FormRepository $formRepository, array $fieldDefinitions)
3737
$code = $tableColumn['COLUMN_NAME'];
3838

3939
if (empty($fieldType)) {
40-
// @todo: echo 'Unknown field type: '.$tableColumn['DATA_TYPE'];
41-
continue;
40+
$fieldType = 'input';
4241
}
4342

4443
$block = $this->layout->createBlock(Template::class);
@@ -57,7 +56,7 @@ public function resolve(FormRepository $formRepository, array $fieldDefinitions)
5756
$fieldData = array_merge($fieldData, $fieldDefinition);
5857
}
5958

60-
$fields[$code.$fieldData['sort_order']] = $this->fieldFactory->create(
59+
$fields[$code] = $this->fieldFactory->create(
6160
$block,
6261
$fieldData,
6362
);

0 commit comments

Comments
 (0)