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

Found in #1907960: Helper issue for "Comment field"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Active » Needs review
FileSize
815 bytes

Fix looks like this, need to write a test (somehow) though

Status: Needs review » Needs work

The last submitted patch, prepare-cache-2048833.patch, failed testing.

larowlan’s picture

or not

andypost’s picture

Status: Needs work » Needs review
FileSize
1.02 KB

Suppose this should be better

Status: Needs review » Needs work

The last submitted patch, prepare-cache-2048833-4.patch, failed testing.

larowlan’s picture

Ah so now we know why it does what it does, and we have our tests, just need the fix, working on it

yched’s picture

Woops. Indeed.
That's the code branch that runs during field purge (field_attach_load() in "single field" mode).

larowlan’s picture

Status: Needs work » Needs review
FileSize
1.95 KB
1.17 KB

Fail/Pass

yched’s picture

Status: Needs review » Reviewed & tested by the community

Looks good if green. Thanks !

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1aebdc7 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.