\Drupal\Core\Entity\EntityDisplayBase::postSave() resets the render cache for the entity type the Display is about.
This thus runs for both EntityViewDisplay and EntityFormDisplay objects.

This is fine for EntityViewDisplay objects, since they control how an entity gets rendered,
but there's no need for EntityFormDisplay to invalidate the "view" cache ?

#1 2384163-EntityFormDisplay_render_cache-1.patch2.03 KByched
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,907 pass(es). View


yched’s picture

Issue summary: View changes
Status: Active » Needs review
2.03 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,907 pass(es). View


Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Nice, makes sense. There's no bug other than too many caches being cleared, I don't think we need a test for that (A test would save a form display and then ensure that no cache is cleared, that is not very helpful/useful).

And the existing tests all still pass.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed ea13784 and pushed to 8.0.x. Thanks!

  • alexpott committed ea13784 on 8.0.x
    Issue #2384163 by yched: Entity render cache is needlessly cleared when...

Status: Fixed » Closed (fixed)

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