Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
For revisionable entity types, core's SQL entity storage always creates dedicated data and revision tables for configurable and multi-valued base fields.
However, DefaultTableMapping::getTableNames()
does not return the revision table name for multi-valued base fields of a revisionable entity type.
Proposed resolution
Fix \Drupal\Core\Field\BaseFieldDefinition::isRevisionable()
to return TRUE when the base field has multiple values.
Remaining tasks
Review.
User interface changes
Nope.
API changes
Nope.
Data model changes
Nope, the storage correctly creates the table already.
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff-6.txt | 1.44 KB | amateescu |
#6 | 2947351-6.patch | 4.84 KB | amateescu |
#2 | 2947351.patch | 3.66 KB | amateescu |
#2 | 2947351-test-only.patch | 3.02 KB | amateescu |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThis patch should fix it.
I looked into #2497737: Entity type revisionability is not taken into account when switching field revisionability first, but it's not the same problem.
Comment #4
BerdirMakes sense, we currently always create revision tables for configurable fields as you said.
Comment #5
hchonovWhat about adding this to the documentation of the methods
\Drupal\Core\Field\FieldStorageDefinitionInterface::isRevisionable()
and\Drupal\Core\Field\BaseFieldDefinition::setCardinality()
?Comment #6
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedSure, why not :)
Comment #7
hchonovThank you!
Comment #8
alexpottCommitted 314ea3c and pushed to 8.6.x. Thanks!
Left open on 8.5.x for backport once 8.5.0 is out.
Comment #10
alexpottSetting the issue to patch to be ported for cherry-pick once 8.5.0 is out. let's not clog the rtbc queue and ptbp makes them easy to find once 8.5.0 is out.
Comment #11
alexpottCommitted 9a3a334 and pushed to 8.5.x. Thanks!