From c569cec4ea49612ddc9d430d7fe792971c93c586 Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Fri, 31 May 2019 10:21:07 +1200 Subject: [PATCH] NEW Add updateHintsCacheKey extension point to fix invalid caching If a module augments the allowed pagetypes based on external conditions, the Hints Cache Key will not cover these conditions and may cause incorrect output. An example of this is Subsites, which allows each Subsite to have a different set of allowed pagetypes. --- code/Controllers/CMSMain.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php index 5f41b325..9fa20345 100644 --- a/code/Controllers/CMSMain.php +++ b/code/Controllers/CMSMain.php @@ -2272,7 +2272,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr */ protected function generateHintsCacheKey($memberID) { - return md5($memberID . '_' . __CLASS__); + $baseKey = $memberID . '_' . __CLASS__; + + $this->extend('updateHintsCacheKey', $baseKey); + + return md5($baseKey); } /**