Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.

Commit 50673df

Browse files
committed
Change configuration cache timestamp if is_admin()
1 parent 00e7e5f commit 50673df

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/Cache/CacheConfigurationManager.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public function getNamespace(): string
2727
{
2828
// The timestamp from when last saving settings/modules to the DB
2929
$userSettingsManager = UserSettingsManagerFacade::getInstance();
30-
return '_' . $userSettingsManager->getTimestamp();
30+
$timestamp = '_' . $userSettingsManager->getTimestamp();
31+
// admin/non-admin screens have different services enabled
32+
if (\is_admin()) {
33+
$timestamp .= '_admin';
34+
}
35+
return $timestamp;
3136
}
3237
}

src/Hooks/ApplicationStateHooks.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ class ApplicationStateHooks extends AbstractHookSet
1111
{
1212
protected function init()
1313
{
14-
$this->hooksAPI->addFilter(
15-
ModelInstance::HOOK_COMPONENTSFROMVARS_RESULT,
16-
[$this, 'addComponent']
17-
);
14+
// ----------------------------------------
15+
// Commented, since `is_admin` is added to
16+
// `CacheConfigurationManager.getNamespace()`
17+
// ----------------------------------------
18+
// $this->hooksAPI->addFilter(
19+
// ModelInstance::HOOK_COMPONENTSFROMVARS_RESULT,
20+
// [$this, 'addComponent']
21+
// );
22+
// ----------------------------------------
1823
}
1924
/**
2025
* Admin and non-admin have different schemas

0 commit comments

Comments
 (0)