ITX bug and patch
| From: | Dietrich Ayala | Date: | Wed, 07 Nov 2001 03:00:38 +0000 |
| Subject: | ITX bug and patch | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2589@lists.php.net to get a copy of this message | ||
ITX doesn't register the variables of blocks that are inner blocks of a
block created using addBlock() or addBlockfile().
if there are blocks inside blocks created by those methods, an error occurs
upon calling the parse() method.
attached is a patch that adds variable registration functionality for inner
blocks, and adds error checking to the updateBlockvariablelist() method.
thanks,
dietrich
260c260 < --- > 263c263,269 < --- > // check if any inner blocks were found > if(is_array($this->blockinner[$blockname]) and count($this->blockinner[$blockname]) > 0){ > // loop through inner blocks, registering the variable placeholders in each > foreach($this->blockinner[$blockname] as $childBlock){ > $this->updateBlockvariablelist($childBlock); > } > } 600,602c606,612 < while (list($k,$varname) = each($regs[1])) { < $this->blockvariables[$block][$varname] = true; < } --- > > if (0 != count($regs[1])) { > foreach ($regs[1] as $k => $var) { > $this->blockvariables[$block][$var] = true; > } > } else { > $this->blockvariables[$block] = array(); 603a614 > }
260c260 < --- > 263c263,269 < --- > // check if any inner blocks were found > if(is_array($this->blockinner[$blockname]) and count($this->blockinner[$blockname]) > 0){ > // loop through inner blocks, registering the variable placeholders in each > foreach($this->blockinner[$blockname] as $childBlock){ > $this->updateBlockvariablelist($childBlock); > } > } 600,602c606,612 < while (list($k,$varname) = each($regs[1])) { < $this->blockvariables[$block][$varname] = true; < } --- > > if (0 != count($regs[1])) { > foreach ($regs[1] as $k => $var) { > $this->blockvariables[$block][$var] = true; > } > } else { > $this->blockvariables[$block] = array(); 603a614 > }