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.
Updated: Comment #0
Problem/Motivation
FieldItems can optionally implement PrepareCacheInterface however the code assumes they all implement the interface (http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/modul...) and blindly calls the prepareCache method on them
Proposed resolution
Ensure the interface is implemented before calling prepareCache.
Remaining tasks
Write patch
Write tests
Review
User interface changes
None
API changes
None
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#8 | prepare-cache-2048833.fail_.patch | 1.17 KB | larowlan |
#8 | prepare-cache-2048833.pass_.patch | 1.95 KB | larowlan |
#4 | prepare-cache-2048833-4.patch | 1.02 KB | andypost |
#1 | prepare-cache-2048833.patch | 815 bytes | larowlan |
Comments
Comment #1
larowlanFix looks like this, need to write a test (somehow) though
Comment #3
larowlanor not
Comment #4
andypostSuppose this should be better
Comment #6
larowlanAh so now we know why it does what it does, and we have our tests, just need the fix, working on it
Comment #7
yched CreditAttribution: yched commentedWoops. Indeed.
That's the code branch that runs during field purge (field_attach_load() in "single field" mode).
Comment #8
larowlanFail/Pass
Comment #9
yched CreditAttribution: yched commentedLooks good if green. Thanks !
Comment #10
alexpottCommitted 1aebdc7 and pushed to 8.x. Thanks!