The _conditional_styles_theme() function within zen-internals/template.conditional-styles.inc lacks the extra file path wrapper for base_path to be CDN-compatible.

Need to be: $base_path = file_create_url(base_path());
Currently is: $base_path = base_path();

This issue started in the CDN issue queue: #1482694: Conditional stylesheets (Zen theme)

Creating patch now.

Comments

doublejosh’s picture

Status: Active » Needs review
StatusFileSize
new2.32 KB

patch

danillonunes’s picture

+++ b/zen-internals/template.conditional-styles.incundefined
@@ -64,7 +64,7 @@ function _conditional_styles_theme($existing, $type, $theme, $path) {
-        $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
+        $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);       ¶

White space issue.

+++ b/zen-internals/template.conditional-styles.incundefined
@@ -73,12 +73,24 @@ function _conditional_styles_theme($existing, $type, $theme, $path) {
-                $link = "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$base_path$path/$file$query_string\" />\n";
+                if ((module_exists('cdn'))) {
+                  $full_path = file_create_url("$path/$file");
+                }
+                else {
+                  $full_path = "$base_path$path/$file";
+                }
+                $link = "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$full_path$query_string\" />\n";

It's possible that CDN module is enabled but CDN status at admin/settings/cdn is disabled.

Why no just always use file_create_url()?

+++ b/zen-internals/template.conditional-styles.incundefined
@@ -73,12 +73,24 @@ function _conditional_styles_theme($existing, $type, $theme, $path) {
-                  $output_rtl .= "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$base_path$path/$file_rtl$query_string\" />\n";
+                  if ((module_exists('cdn'))) {
+                    $full_path_rtl = file_create_url("$path/$file_rtl");
+                  }
+                  else {
+                    $full_path_rtl = "$base_path$path/$file_rtl";
+                  }
+                  $output_rtl .= "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$full_path_rtl$query_string\" />\n";

Ditto.

danillonunes’s picture

Status: Needs review » Needs work

I tested it today and it's not providing the functionality. I put more info on the CDN Issue #1482694: Conditional stylesheets (Zen theme)

johnalbin’s picture

Status: Needs work » Closed (won't fix)

The 6.x-2.x branch is in bug-fix only mode.

johnalbin’s picture

Issue summary: View changes

improve clarity