My entity definition has a string field whose default value should be ''
However whereever I specify in the entity creation and saving process that the field should be a string, NULL is written to the db.
I can't find a similar use-case in core to check if I'm doing something wrong.
This looks related to https://www.drupal.org/node/2318605
Here is my full field definition

    $fields['name'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Name'))
      ->setDescription(t("Description"))
      ->setSetting('max_length', 64)
      ->setDefaultValue('');

Comments

matslats created an issue. See original summary.

dawehner’s picture

Status: Active » Closed (duplicate)