- Issue created by @joachim
- πΊπΈUnited States cilefen
Is this the same as β¨ Do not require a 'title' field Needs work ?
- π¬π§United Kingdom joachim
What I don't understand is how the same procedue on the Custom Block entity type does NOT crash, when both fields look very similar in their definition:
$fields['title'] = BaseFieldDefinition::create('string') ->setLabel(t('Title')) ->setRequired(TRUE) ->setTranslatable(TRUE) ->setRevisionable(TRUE) ->setSetting('max_length', 255) ->setDisplayOptions('view', [ 'label' => 'hidden', 'type' => 'string', 'weight' => -5, ]) ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -5, ]) ->setDisplayConfigurable('form', TRUE); $fields['info'] = BaseFieldDefinition::create('string') ->setLabel(t('Block description')) ->setDescription(t('A brief description of your block.')) ->setRevisionable(TRUE) ->setTranslatable(TRUE) ->setRequired(TRUE) ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -5, ]) ->setDisplayConfigurable('form', TRUE) ->addConstraint('UniqueField', []);
What is different?
The DB field in {node_field_data} does not have ALLOW NULL, but for {block_content_field_data} it does.
- πΊπΈUnited States cilefen
Understood. But with β¨ Do not require a 'title' field Needs work and its duplicates over the years, this seems the same issue.
- πΊπΈUnited States cilefen
Also, π Fatal error when title field is empty(Integrity constraint violation) Active .