
Problem/Motivation
A custom_block
maybe be varied by language and it is also revisionable.
The langcode
field definition is not marked as revisionable.
// \Drupal\custom_block\Entity\CustomBlock
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
...
$fields['langcode'] = FieldDefinition::create('language')
->setLabel(t('Language code'))
->setDescription(t('The custom block language code.'));
...
}
The problem is that the database schema for the custom_block_revision
table in custom_block.install
doesn't include langcode as a DB field.
The plan is to generate tables automatically from entity type schema configuration instead of describing the DB table structure (and duplicating/perhaps with errors as is the case here) in an install file. See #1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions.
Once that happens, we can get this committed.
Proposed resolution
Commit the attach patch when #1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions is resolved
User interface changes
None.
API changes
None.
Postponed until
Original report by @jessebeach
Comment | File | Size | Author |
---|---|---|---|
#1 | custom-block-revisionable-by-langcode-2226445-1.patch | 1.3 KB | jessebeach |
Comments
Comment #1
jessebeach CreditAttribution: jessebeach commentedHere's the necessary change.
Comment #2
jessebeach CreditAttribution: jessebeach commentedComment #3
plachThis already happened in #2312153: Refactor block_content entity schema to multilingual.
Comment #4
plach