@@ -49,20 +49,22 @@ public function __construct(ILogger $logger, $theme, $core_map, $party_map, $scs
4949 * @param string $style
5050 */
5151 public function doFind ($ style ) {
52+ $ app = substr ($ style , 0 , strpos ($ style , '/ ' ));
5253 if (strpos ($ style , '3rdparty ' ) === 0
5354 && $ this ->appendIfExist ($ this ->thirdpartyroot , $ style .'.css ' )
54- || $ this ->cacheAndAppendScssIfExist ($ this ->serverroot , $ style .'.scss ' )
55+ || $ this ->cacheAndAppendScssIfExist ($ this ->serverroot , $ style .'.scss ' , $ app )
5556 || $ this ->cacheAndAppendScssIfExist ($ this ->serverroot , 'core/ ' .$ style .'.scss ' )
5657 || $ this ->appendIfExist ($ this ->serverroot , $ style .'.css ' )
5758 || $ this ->appendIfExist ($ this ->serverroot , 'core/ ' .$ style .'.css ' )
5859 ) {
5960 return ;
6061 }
61- $ app = substr ($ style , 0 , strpos ($ style , '/ ' ));
6262 $ style = substr ($ style , strpos ($ style , '/ ' )+1 );
6363 $ app_path = \OC_App::getAppPath ($ app );
6464 $ app_url = \OC_App::getAppWebPath ($ app );
65- $ this ->append ($ app_path , $ style .'.css ' , $ app_url );
65+ if (!$ this ->cacheAndAppendScssIfExist ($ app_path , $ style .'.scss ' , $ app )) {
66+ $ this ->append ($ app_path , $ style .'.css ' , $ app_url );
67+ }
6668 }
6769
6870 /**
@@ -80,14 +82,13 @@ public function doFindTheme($style) {
8082 *
8183 * @param string $root path to check
8284 * @param string $file the filename
83- * @param string|null $webRoot base for path, default map $root to $webRoot
8485 * @return bool True if the resource was found and cached, false otherwise
8586 */
86- protected function cacheAndAppendScssIfExist ($ root , $ file , $ webRoot = null ) {
87+ protected function cacheAndAppendScssIfExist ($ root , $ file , $ app = ' core ' ) {
8788 if (is_file ($ root .'/ ' .$ file )) {
8889 if ($ this ->scssCacher !== null ) {
89- if ($ this ->scssCacher ->process ($ root , $ file )) {
90- $ this ->append ($ root , $ this ->scssCacher ->getCachedSCSS (' core ' , $ file ), $ webRoot , false );
90+ if ($ this ->scssCacher ->process ($ root , $ file, $ app )) {
91+ $ this ->append ($ root , $ this ->scssCacher ->getCachedSCSS ($ app , $ file ), false );
9192 return true ;
9293 } else {
9394 $ this ->logger ->error ('Failed to compile and/or save ' .$ root .'/ ' .$ file , ['app ' => 'core ' ]);
0 commit comments