Possible IT Template Bug

From: Date: Tue, 22 Jul 2003 08:02:25 +0000
Subject: Possible IT Template Bug
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18519@lists.php.net to get a copy of this message
I recently sent the following message to the pear-general list and have not yet received a response. I am reposting it here as it could possibly be a bug, or at least one that somebody may be aware of and hence, may be able give me an answer. Unfortunately I cannot upgrade the machine in question to the latest version of PHP as it is on a shared machine to see if that fixes the issue, and I have been unable to find any information regarding the issue on the PHP/PEAR site, or the web in general. Many thanks Jake I have bee using the HTML/IT.php package quite happily for a while now on PHP 4.2.2. However I have just tried to install some code on another machine using 4.3.0 and have run into problems. I seem to be having problems were I have an empty block that I want to preserve. Now I know I could use the Select.php package to do the following but I have my reasons (although now I come to think of it, I can't remember why): <select class="leftMenu" name="newcompanyid"> <!-- BEGIN companySelect --> <option value="{companySelectId}" <!-- BEGIN companySelected -->selected <!-- END companySelected -->>{companySelectName}</option> <!-- END companySelect --> </select> Excuse the word wrap. And the following code: /* Fetch the results */ while ($row = $result->fetchRow (DB_FETCHMODE_ASSOC)) { if ($row['id'] == $this->defaults['companyid']) { $template->setCurrentBlock ("companySelected"); $template->parseCurrentBlock ("companySelected"); $template->touchBlock ("companySelected"); } $template->setCurrentBlock ("companySelect"); $template->setVariable ("companySelectId", $row['id']); $template->setVariable ("companySelectName", $row['name']); $template->parseCurrentBlock ("companySelect"); } Now in PHP 4.2.2 all works fine and I get the following: <select class="leftMenu" name="newcompanyid"> <option value="70" >Company 70</option> <option value="1" selected >Company 1</option> </select> Hoever in PHP 4.3.0 I get this: <select class="leftMenu" name="newcompanyid"> <option value="1" selected >My Company</option> <option value="" selected ></option> </select> is this a bug or am I doing something wrong? Thanks Jake

« previous php.pear.dev (#18519) next »