mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Fix string form/view display config.
This commit is contained in:
parent
f1fd5b0dfb
commit
5b3d757f2f
1 changed files with 11 additions and 2 deletions
|
@ -447,14 +447,23 @@ function farm_field_base_field_definition_entity_reference(BaseFieldDefinition &
|
|||
*/
|
||||
function farm_field_base_field_definition_string(BaseFieldDefinition &$field, array $options = []) {
|
||||
|
||||
// Set default settings.
|
||||
$field->setSetting('max_length', 255);
|
||||
$field->setSetting('is_ascii', FALSE);
|
||||
$field->setSetting('case_sensitive', FALSE);
|
||||
|
||||
// Build form and view display settings.
|
||||
$field->setDisplayOptions('form', [
|
||||
'type' => $options['type'],
|
||||
'type' => 'string_textfield',
|
||||
'settings' => [
|
||||
'size' => 60,
|
||||
'placeholder' => '',
|
||||
],
|
||||
'weight' => $options['weight']['form'] ?? 0,
|
||||
]);
|
||||
$field->setDisplayOptions('view', [
|
||||
'label' => 'inline',
|
||||
'type' => $options['type'],
|
||||
'type' => 'string',
|
||||
'weight' => $options['weight']['view'] ?? 0,
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue