- First commit to issue fork.
I have a custom entity and wanted to add a field of type "double field" with unlimited values. Any suggestions? I tried using the below sample code but I get this error when about to create content of the custom entity.
"Notice: Undefined index: list /double_field/src/Plugin/Field/FieldWidget/DoubleField.php on line 505 Call Stack: 0.2006 424392 1. {main}() /app/web/index.php:0 0.2098 598240 2. Drupal\Core\DrupalKernel->handle() /app/web/index.php:19 0.2259 2254168 3. Stack\StackedHttpKernel->handle()......"
$fields['File'] = BaseFieldDefinition::create('double_field')
->setLabel(t('File'))
->setSettings([
'first' => [
'type' => 'string',
'label' => 'File name',
'maxlength' => 255,
],
'second' => [
'type' => 'string',
'label' => 'File ID',
'maxlength' => 255,
],
])
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'double_field_unformatted_list',
'weight' => 3,
])
->setDisplayOptions('form', [
'type' => 'double_field',
'weight' => 3,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
Fixed
3.0
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.