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

Issue Type: Bug Created: 2010-01-17T09:19:37.000+0000 Last Updated: 2010-01-17T15:42:05.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

  • 1.10.1 (10/Feb/10)

Reporter: Rob Allen (rob) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_View

Related issues: Attachments:


Consider this code in a view script:

<pre class="highlight">
$this->headScript()->prependFile('<a href=""></a>',
    'text/javascript', array('conditional'=>'IE'));

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

output is:

<pre class="literal">

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


<pre class="literal">


Posted by Rob Allen (rob) on 2010-01-17T09:22:57.000+0000

The simplest patch is this:

<pre class="highlight">
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 . '';

Posted by Marc Bennewitz (private) (mabe) on 2010-01-17T15:09:30.000+0000

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

Posted by Matthew Weier O'Phinney (matthew) on 2010-01-17T15:16:38.000+0000

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.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-01-17T15:22:53.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2010-01-17T15:40:29.000+0000

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).

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-01-17T15:42:05.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.