Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.0
-
Fix Version/s: 1.5.1
-
Component/s: None
-
Labels:None
Description
Expect this code:
foreach ($this->layout()->metaHeader['css'] as $key => $array) { echo $this->headLink()->appendStylesheet( $array['href'], $array['media'], $array['conditionalStylesheet'])->toString(); }
or this
<?php if (is_array($this->layout()->metaHeader['css'])) { foreach ($this->layout()->metaHeader['css'] as $key => $array) { echo $this->headLink()->appendStylesheet($array['href'], $array['media'], false); } } ?>
with this config:
$array['href'] = 'landing-page.css' $array['media'] = 'screen' $array['conditionalStylesheet'] = false; // Docu says boolean !!
does not work right...
The failure is within HeadLink.php...
if (0 < count($args)) {
$conditionalStylesheet = array_shift($args);
$conditionalStylesheet = (string) $conditionalStylesheet;
}
it has to check for "false" before converting to string otherwise it will contain the string false instead of 0.
The problem can be fixed by adding this code:
if (false !== $conditionalStylesheet) { $conditionalStylesheet = (string) $conditionalStylesheet; }
Fixed with SVN-8852