Issues

ZF-8848: A conditional headScript() doesn't output indent correctly

Description

Consider this code in a view script:


$this->headScript()->prependFile('http://html5shiv.googlecode.com/svn/trunk/html5.js',
    'text/javascript', array('conditional'=>'IE'));

echo $this->headScript()->setIndent(4);

output is:

   

Note that the indent has occurred before the conditional is applied.

expected:

       

Comments

The simplest patch is this:


Index: library/Zend/View/Helper/HeadScript.php
===================================================================
--- library/Zend/View/Helper/HeadScript.php (revision 20351)
+++ library/Zend/View/Helper/HeadScript.php (working copy)
@@ -434,7 +434,7 @@
             && !empty($item->attributes['conditional'])
             && is_string($item->attributes['conditional']))
         {
-            $html = '';
+            $html =  $indent . '';
         }

fixed in r20363 (trunk) & r20364 (1.10 branch) & r20365 (1.9 branch)

Thanks for the fix!

Going forward, there's no need to apply fixes to the 1.9 branch; we've done the last bugfix release on that branch at this time.

Out of curiosity, what's wrong with merging non BC breaking bugfixes into older branches? I can imagine companies who can't upgrade to a next minor version appreciate it, besides that. though ZF is bugfree, we just may have another security release some time.

Dolf: we (a) don't have enough resources to backport, and (b) don't have a policy on the practice.

As for (a), to given an example: the backports for the security patches sometimes took up to an hour per patch per release branch, due to differences between branches. This kind of effort takes a fair bit of time.

As for (b), if some contributors backport, and others don't, we have very inconsistent trees between different release branches. Additionally, since there's no policy, how far back will we go? previous release branch? previous 3? all the way back to 1.6 so that developers on PHP < 5.2.4 have the fixes? And who's keeping an eye on the unit tests for the previous branches, and ensuring a bugfix doesn't break the tree?

At this time, it's easiest to simply say that the release tree stays as it was for the last release on that branch, with the exception of security fixes (the security policy states we will patch the previous two release branches in addition to the current one).

Fair enough. Thanks for the clarification, and enjoy your weekend (as long as it's got to last ;))