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.
Since #2211723: FieldInstance::__construct() loads all field_config entities, FieldInstanceConfig::$field is lazy-loaded in getFieldStorageDefinition(), and thus should never be accessed directly.
FieldInstanceConfig::postDelete() still has code that does that, though.
It works, because preDelete() happens to call getFieldStorageDefinition(), and thus $field is always populated when postDelete() runs - which also makes this not testable...
Comment | File | Size | Author |
---|---|---|---|
#1 | 2295447-FIC_field-1.patch | 1.3 KB | yched |
Comments
Comment #1
yched CreditAttribution: yched commentedComment #2
yched CreditAttribution: yched commentedComment #3
BerdirComment #4
yched CreditAttribution: yched commentedDoh, thanks.
Green :-)
Comment #5
BerdirYes, looks fine, agreed that we can't really test this, as it's not possible to actually produce an error. More like a clean-up task, than a bugfix.
Comment #6
alexpottCommitted 3c94e31 and pushed to 8.x. Thanks!