PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_NestedSet » Bug #1188

wrong node in createNode listeners

Details

Submitted2004-04-12 18:52 UTC
Frompriit at e-positive dot ee
Assigneddatenpunk
StatusClosed
PackageDB_NestedSet
PHP Version4.3.4
OSwin
Roadmaps(Not assigned)

Comments

[2004-04-12 18:52 UTC] priit at e-positive dot ee

Description:
------------
there's a bug in all create functions ( except createRootNode ) when calling listeners

// EVENT (NodeCreate)
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCreate'])) {
$this->triggerEvent('nodeCreate', $this->pickNode($id));
}

and listener is called with the PARENT of just created node...

It should be

// EVENT (NodeCreate)
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCreate'])) {
$this->triggerEvent('nodeCreate', $this->pickNode($node_id));
}

[2004-04-12 19:45 UTC] dk at webcluster dot at

I will fix this within the next release but please note that the event listeners will go away one day as it was a mistake to ever include them.
Everything the listeners where intended to can be done with $addSQL and other techniques in userland.
So please PM me if you need help with it.
However - it will be fixed ;)

--
Daniel Khan

[2004-04-12 20:05 UTC] priit at e-positive dot ee

I need those listeners as I have no intention to start write stored procedures - i like to have ability to use multiple engines, not just one.

I have here something like Win Management Console - one tree linked with many different tables. By adding/dropping a node I sometimes need to do lot of database operations.

Anyway I can add them back some way or another :-)

[2004-04-12 20:07 UTC] dk at webcluster dot at

I'll surely fix it.
BTW I have something similar. I now use event handlers in userland which works very fine.

[2004-07-23 22:24 UTC] dk at webcluster dot at

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.

Sorry for the delay!