Skip to content

Commit b5c5fae

Browse files
authored
Merge pull request #10484 from nextcloud/bugfix/noid/theming-cache-update
Append cache bump parameter to scss files URL
2 parents e65ca39 + 6ce4745 commit b5c5fae

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/private/Template/SCSSCacher.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,11 @@ public function getCachedSCSS(string $appName, string $fileName): string {
388388
$fileName = array_pop($tmpfileLoc);
389389
$fileName = $this->prependVersionPrefix($this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileName)), $appName);
390390

391-
return substr($this->urlGenerator->linkToRoute('core.Css.getCss', ['fileName' => $fileName, 'appName' => $appName]), strlen(\OC::$WEBROOT) + 1);
391+
return substr($this->urlGenerator->linkToRoute('core.Css.getCss', [
392+
'fileName' => $fileName,
393+
'appName' => $appName,
394+
'v' => $this->config->getAppValue('core', 'scss.variables', '0')
395+
]), \strlen(\OC::$WEBROOT) + 1);
392396
}
393397

394398
/**

tests/lib/Template/SCSSCacherTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ public function testGetCachedSCSS($appName, $fileName, $result, $version) {
458458
->with('core.Css.getCss', [
459459
'fileName' => substr(md5($version), 0, 4) . '-' .
460460
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-styles.css',
461-
'appName' => $appName
461+
'appName' => $appName,
462+
'v' => 0,
462463
])
463464
->willReturn(\OC::$WEBROOT . $result);
464465
$actual = $this->scssCacher->getCachedSCSS($appName, $fileName);

0 commit comments

Comments
 (0)