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
Since #2951242: Allow BaseFieldDefinition::setInitialValueFromField() to set a default value - this fixes issues with block_content_update_8400(), it is possible that a database field schema specification to have both initial
and initial_from_field
set, which means that two update queries will be executed to set the initial value when the field is added to the table.
Proposed resolution
Change the execution order so only one update query is performed.
Remaining tasks
Review.
User interface changes
Nope.
API changes
Nope.
Data model changes
Nope.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2990118.patch | 2.49 KB | amateescu |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThis should do it.
Comment #3
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedNote that this was already fixed for SQLite in #2982759: EntityUpdateToRevisionableAndPublishableTest wrongly assumes entities should be converted to revisionable and publishable in a single step.
Comment #4
timmillwoodLGTM
Comment #5
alexpottNice one less query on updates where
initial_from_field
is set. As we're about to have lots of updates run applied to 8.6.x as well I've backported this very non-disruptive change to 8.6.xCommitted and pushed bc328489db to 8.7.x and 86e0dbeb57 to 8.6.x. Thanks!