ZF-2663: Set name in headMeta View Helper deletes previous entries
Description
<
pre class="highlight">
[Test Script]
<?php
set_include_path('../zf-trunk/library');
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$view = new Zend_View;
$view->headMeta()->setName('keywords', 'php application');
$view->headMeta()->appendHttpEquiv('pragma', 'no-cache');
$view->headMeta()->appendHttpEquiv('Cache-control', 'no-cache');
$view->headMeta()->setName('keywords', 'xavi');
?>
<?php
echo htmlentities($view->headMeta()->setPostfix("\n"));
[Expected Output]
[Actual Output]
(Run against: r7761 & r8026)
CG wrote: I was expecting the second call to setName() to only override the 'keywords' index/property. Is this simply a misunderstanding on Xavier's and my side or this this indeed a bug?
MO'P wrote: Bug. Please file an issue in JIRA with the above reproduce/expect/actual information so either Ralph or I can look into it.
Comments
Posted by Ralph Schindler (ralph) on 2008-02-21T11:46:36.000+0000
Fixed in r8253.
Please check, if not completely fixed, then reopen.
-ralph
Posted by Wojciech Naruniec (wojciech) on 2008-06-09T14:06:06.000+0000
Use case provided by CG works after r8253 fix, but this doesn't:
<
pre class="highlight">
[Test Script] <?php set_include_path('/Users/cyphelf/Sites/ZendFramework/library'); require_once 'Zend/Loader.php'; Zend_Loader::registerAutoload(); $view = new Zend_View; $view->headMeta()->setName('keywords', 'php application'); $view->headMeta()->setName('description', 'php application'); $view->headMeta()->appendHttpEquiv('pragma', 'no-cache'); $view->headMeta()->appendHttpEquiv('Cache-control', 'no-cache'); $view->headMeta()->setName('keywords', 'xavi'); ?><?php echo $view->headMeta()->setPostfix("\n"); ?> [Expected Output] [Actual Output] (Run against: r9647)Posted by Wojciech Naruniec (wojciech) on 2008-06-09T14:24:12.000+0000
It's a fix:
Posted by Andrew Ballard (aballard) on 2008-06-27T07:38:03.000+0000
The fix posted by Wojciech Naruniec is close, but it only works for meta name entries.
This condition
should replaced with
Posted by Ralph Schindler (ralph) on 2008-07-25T23:56:05.000+0000
Fixed in trunk in r10457 Fixed in 1.5 branch in r10458 Fixed in 1.6 branch in r10459