Problem/Motivation

A custom_block maybe be varied by language and it is also revisionable.

Screenshot of a custom block edit form. The language select box is indicated as well as the new revision checkbox.

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

#1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions

Original report by @jessebeach

Comments

jessebeach’s picture

Here's the necessary change.

jessebeach’s picture

plach’s picture

Status:Postponed» Closed (duplicate)
Related issues:+#2312153: Refactor block_content entity schema to multilingual
plach’s picture