Support entity types without revisions

Created on 21 December 2023, 12 months ago
Updated 15 January 2024, 11 months ago

I extending abstract class EntityTitleLength for another entity type. For this entity type revisions not enabled.

During module enabling I recieve next error:
Undefined table: 7 ERROR: relation "{entity_type}_relationship_field_revision" does not exist

This error because of method changeLength() doesn't check if revisions for entity enabled.

I suggest to:

  1. Check if entity is revisionable
  2. Get revision data table using $entity_type_definition->getRevisionDataTable()
  3. Make injected properties with dependency injections protected instead of private for anyone who would like override changeLength method and reuse injected dependencies.
Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇷🇺Russia qzmenko Novosibirsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024