ZF-2204: wrong stacking of plugins.
Description
It's description of Matthew Weier O'Phinney: "Let's say you have 3 plugins, one registered with no stackIndex, one with a stackIndex of 99, and another with one of 50. If you register another, it will get a stackIndex of 3, when it should get a stackIndex of 1. "
public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)
{
//code
} else {
$stackIndex = count($this->_plugins); // why?
while (isset($this->_plugins[$stackIndex])) {
++$stackIndex;
}
$this->_plugins[$stackIndex] = $plugin;
}
//code
}
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2007-11-16T14:52:14.000+0000
Scheduling for 1.0.3
Posted by Matthew Weier O'Phinney (matthew) on 2007-11-26T15:49:13.000+0000
Postponing to 1.1.0. Right now, I can't figure out a way to do stack ordering that's (a) easily user manipulable (b) maintains reasonable internal index order when indices are automatically generated, and (c) retains backwards compatibility. When I can sit down with the code and ensure (c) in particular can be met, while meeting (a) and (b), we can proceed -- and that will need to wait for 1.1.0.
Posted by Jordan Ryan Moore (jordanryanmoore) on 2007-12-17T12:44:55.000+0000
Attaching patch that fixes this bug.
Posted by Wil Sinclair (wil) on 2008-04-18T13:12:01.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Ralph Schindler (ralph) on 2008-04-22T10:38:29.000+0000
Updating project management info.
Posted by Matthew Weier O'Phinney (matthew) on 2008-11-05T08:23:02.000+0000
Assigning to Ralph.
Posted by Ralph Schindler (ralph) on 2009-01-10T10:50:10.000+0000
This actually works very similar to how php would increment stack index. Notice:
In our case, the next number represents both the next available positive index AS WELL as the number (if none was provided) of the plugin that was pushed onto the stack. I think this behavior is correct. On the other hand, i think the actual index and top/bottom of the stack might need to be re-evaluated.