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.
Problem/Motivation
While writing the test-cases for #2914579: Improve the tests for the D8 branch I realised that render-cache data was not being properly invaidated / cleared when updating the site_template config-entity as well as corresponding variant enties.
Proposed resolution
- Remove the workarounds in the test-cases from #2914579: Improve the tests for the D8 branch
- Add cacheability meta-data to the render-array created by
PanelsEverywhereDisplayVariant
- Introduce a cache-clear when: enabling / disabling site_template & adding (/ removing) a variant. This should be fix pages which where previously not handled by panels_everywhere.
Comment | File | Size | Author |
---|
Comments
Comment #2
Alumei CreditAttribution: Alumei commentedThis is the latest patch from #2914579: Improve the tests for the D8 branch with the cache-clear workarounds removed from the test-cases.
Comment #3
Alumei CreditAttribution: Alumei commentedCreated a patch to solve the cachability meta-data problem.
Note:
Comment #4
Alumei CreditAttribution: Alumei commentedOh .. forgot to attach the files ... here they are.
Comment #7
Alumei CreditAttribution: Alumei commentedI did the diff wrong for the test-only patch. Here is a correct one.
Comment #9
DamienMcKennaLets see if the tests work now.
Comment #11
DamienMcKennaNeeds to be rerolled.
Comment #12
Alumei CreditAttribution: Alumei commentedRerolled the patch
Comment #13
Alumei CreditAttribution: Alumei commentedNow on to the next part:
Comment #14
Alumei CreditAttribution: Alumei commentedThis fixes the test fails.
It adds cache clears after enabling site_template and display variants to ensure that page which were cached before that happened and which are after that being served are properly cleared. This is necessary because they are not automatically invalidated as they were not dependent on panels_everywhere related config-entites before.
I also just thought of a another edge-cache:
Modifying a page variant to cover additional pages that where not served by panels_everywhere before.
I will try to write a test that proves this assumption.
Comment #15
Alumei CreditAttribution: Alumei commentedHere is a patch with the additional test-cache that proves my assumption.
Will Fix that now.
Comment #16
Alumei CreditAttribution: Alumei commentedHere is a fix for #15.
Comment #18
Alumei CreditAttribution: Alumei commentedThis needs to be rerolled after #2914579: Improve the tests for the D8 branch is in.
Comment #19
Alumei CreditAttribution: Alumei commentedJust realized that the last patch introduces coding standards violations. Fixing that with with this patch.
@DamienMcKenna: If you want, I can fix the remaining violations during the upcoming reroll.
Comment #20
Alumei CreditAttribution: Alumei commentedBack to postponed until #2914579: Improve the tests for the D8 branch is in.
Comment #21
DamienMcKenna#2914579 was committed so this needs a reroll.
Comment #22
Alumei CreditAttribution: Alumei commentedRerolled the patch.
Comment #24
Alumei CreditAttribution: Alumei commentedI cleaned up some comments and fixed the new coding style violation.
Comment #25
Alumei CreditAttribution: Alumei commentedThis last patch fixes the remaining coding standards violations in all files affected by the patch.
Comment #26
DamienMcKennaRerolled and tidied up a little.
Comment #28
Alumei CreditAttribution: Alumei commentedThe previous reroll lost the caching-metadata being passed to pe-display-variant, as such the variant has not meta-data to apply.
This patch fixes that & also cleans up the process a bit.
Comment #30
Alumei CreditAttribution: Alumei commentedReverted some changes made to the failing test in previous patches.
Comment #31
Alumei CreditAttribution: Alumei commentedAfter doing some manual testing I actually realized that the concept for this patch is false.
After all some of the tested functionality does work without the fixes from the recent patch.
I'll investigate this further.
Comment #32
DamienMcKennaComment #33
andypostCore doing some narrowing of possible cache cleaning via #2241377: [meta] Profile/rationalise cache tags
I think site template can just use own tag (per page variant probably) to clean cache precisely for each updated entity