From da283760228304fca1e6369bd31416d69e555ec0 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 3 Apr 2014 16:40:42 +0800 Subject: [PATCH 1/2] MDL-44933 themes: LESS file was served in designer mode and IE --- lib/outputlib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/outputlib.php b/lib/outputlib.php index 8adf2171b65..4112d641e62 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -845,6 +845,13 @@ class theme_config { } } else if ($subtype === 'theme') { $cssfiles = $css['theme']; + foreach ($cssfiles as $key => $value) { + if ($this->lessfile && $key === $this->lessfile) { + // Remove the LESS file from the theme CSS files. + // The LESS files use the type 'less', not 'ie'. + unset($cssfiles[$key]); + } + } } } else if ($type === 'plugin') { From 06a9e10350834badb7a7fa9bd5ee32e0933897bd Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 3 Apr 2014 16:47:12 +0800 Subject: [PATCH 2/2] MDL-44933 themes: Allow chunking of CSS in designer mode --- lib/outputlib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 4112d641e62..8e2328b5e48 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -670,10 +670,10 @@ class theme_config { $urls = array(); $svg = $this->use_svg_icons(); + $separate = (core_useragent::is_ie() && !core_useragent::check_ie_version('10')); if ($rev > -1) { $url = new moodle_url("$CFG->httpswwwroot/theme/styles.php"); - $separate = (core_useragent::is_ie() && !core_useragent::check_ie_version('10')); if (!empty($CFG->slasharguments)) { $slashargs = ''; if (!$svg) { @@ -709,6 +709,10 @@ class theme_config { // We do this because all modern browsers support SVG and this param will one day be removed. $baseurl->param('svg', '0'); } + if ($separate) { + // We might need to chunk long files. + $baseurl->param('chunk', '0'); + } if (core_useragent::is_ie()) { // Lalala, IE does not allow more than 31 linked CSS files from main document. $urls[] = new moodle_url($baseurl, array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'plugins')); @@ -718,7 +722,7 @@ class theme_config { } if (!empty($this->lessfile)) { // No need to define the type as IE here. - $urls[] = new moodle_url($baseurl, array('theme' => $this->name, 'type' => 'less', 'chunk' => 0)); + $urls[] = new moodle_url($baseurl, array('theme' => $this->name, 'type' => 'less')); } $urls[] = new moodle_url($baseurl, array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'theme'));