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
The BlockContent
entity type is translatable and revisionable, but it doesn't declare its revision data table in the annotation.
Proposed resolution
Fix it.
Remaining tasks
Review.
User interface changes
Nope.
API changes
Nope.
Data model changes
Nope.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2858109-7.patch | 7.02 KB | amateescu |
#7 | 2858109-7-test-only.patch | 2.54 KB | amateescu |
#5 | interdiff.txt | 1.81 KB | amateescu |
#5 | 2858109-5.patch | 3.34 KB | amateescu |
#2 | 2858109.patch | 1.53 KB | amateescu |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedLet's fix it.
Comment #3
jibranLet's add some tests.
Comment #5
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThe problem discovered by this patch is that if an entity type doesn't specify a base table in its definition, the entity storage will create it anyway because it needs it but the entity type definition can no longer be updated to include the table name.
This is one way of fixing it but I'm not entirely happy with it :/
Comment #6
jibranI still think we should add a test to check that entity definition is updated after running update hook.
Comment #7
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedOk. Since update path tests are expensive, let's re-use the existing one and add a couple of assertions to it.
The test-only patch is also the interdiff.
Comment #9
jibranAwesome!
Comment #10
alexpottCommitted and pushed 85860ba to 8.4.x and c1eaa26 to 8.3.x. Thanks!
We've just removed all of these. See #2860096: Remove api doc groups for updates eg. updates-8.2.x-to-8.3.x
Comment #13
alexpottShould we file a follow-up to help custom entities not get into the same position?
Comment #14
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedWell, we can't write update functions for custom entities and the changing the storage to not create the tables automatically if they're not defined in the entity definition would be an API change..