mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #36762 from nextcloud/bugfix/noid/scss-reset
Avoid scss cacher reset on empty variables
This commit is contained in:
commit
3a06d335f1
2 changed files with 8 additions and 1 deletions
|
|
@ -272,6 +272,13 @@ class SCSSCacher {
|
|||
private function variablesChanged(): bool {
|
||||
$cachedVariables = $this->config->getAppValue('core', 'theming.variables', '');
|
||||
$injectedVariables = $this->getInjectedVariables($cachedVariables);
|
||||
|
||||
if (empty($injectedVariables)) {
|
||||
// There might be cases where the no variables could be fetched
|
||||
// Stay with the old ones in that case ot avoid cache reset that is not needed
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($cachedVariables !== md5($injectedVariables)) {
|
||||
$this->logger->debug('SCSSCacher::variablesChanged storedVariables: ' . json_encode($this->config->getAppValue('core', 'theming.variables')) . ' currentInjectedVariables: ' . json_encode($injectedVariables), ['app' => 'scss_cacher']);
|
||||
$this->config->setAppValue('core', 'theming.variables', md5($injectedVariables));
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class SCSSCacherTest extends \Test\TestCase {
|
|||
);
|
||||
|
||||
$this->themingDefaults = $this->createMock(ThemingDefaults::class);
|
||||
$this->themingDefaults->expects($this->any())->method('getScssVariables')->willReturn([]);
|
||||
$this->themingDefaults->expects($this->any())->method('getScssVariables')->willReturn(['color-primary' => '#745bca']);
|
||||
|
||||
$iconsFile = $this->createMock(ISimpleFile::class);
|
||||
$this->iconsCacher->expects($this->any())
|
||||
|
|
|
|||
Loading…
Reference in a new issue