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.
As discovered in #1980822: Support any entity with path.module storage-related methods are not invoked for computed fields. Attached patch should fix it.
Comment | File | Size | Author |
---|---|---|---|
d8_field_method_computed.patch | 796 bytes | fago | |
Comments
Comment #1
fagoAs discussed with berdir, this could need test coverage and for that a computed-field test implementation.
Comment #2
sunIMHO, #1980822: Support any entity with path.module will be sufficient for test coverage.
Comment #3
fagod8_field_method_computed.patch queued for re-testing.
Comment #4
alexpottCommitted a0fb280 and pushed to 8.x. Thanks!
Comment #5
yched CreditAttribution: yched commentedOuch...
We advertize "foreach ($entity as $items)" as the new handy way to iterate over fields in an entity, but it seems easy to overlook that it skips computed fields.
Shouldn't it iterate on computed as well ?
Comment #6
yched CreditAttribution: yched commentedOops, my previous comment had a typo that completely blurs it.
"Shouldn't it iterate on no computed as well ?" -> "Shouldn't it iterate on computed as well ?"
Edited it.