Merge pull request #10484 from nextcloud/bugfix/noid/theming-cache-update

Append cache bump parameter to scss files URL
This commit is contained in:
Roeland Jago Douma 2018-08-01 13:28:53 +02:00 committed by GitHub
commit b5c5faebfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -388,7 +388,11 @@ class SCSSCacher {
$fileName = array_pop($tmpfileLoc);
$fileName = $this->prependVersionPrefix($this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileName)), $appName);
return substr($this->urlGenerator->linkToRoute('core.Css.getCss', ['fileName' => $fileName, 'appName' => $appName]), strlen(\OC::$WEBROOT) + 1);
return substr($this->urlGenerator->linkToRoute('core.Css.getCss', [
'fileName' => $fileName,
'appName' => $appName,
'v' => $this->config->getAppValue('core', 'scss.variables', '0')
]), \strlen(\OC::$WEBROOT) + 1);
}
/**

View file

@ -458,7 +458,8 @@ class SCSSCacherTest extends \Test\TestCase {
->with('core.Css.getCss', [
'fileName' => substr(md5($version), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-styles.css',
'appName' => $appName
'appName' => $appName,
'v' => 0,
])
->willReturn(\OC::$WEBROOT . $result);
$actual = $this->scssCacher->getCachedSCSS($appName, $fileName);