ZF-9675: Using _postInsert() to save() creates an infinite loop - Zend_Db_Table_Row_Abstract

Issue Type: Bug Created: 2010-04-14T00:19:15.000+0000 Last Updated: 2011-02-03T13:58:43.000+0000 Status: Open Fix version(s): Reporter: Scott Hovestadt (scott.hovestadt) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Table

Related issues: Attachments:


If save() is triggered by _postInsert() (within the function itself or by code it executes), an infinite loop is created. This happens because _refresh(), which creates clean data, is called AFTER postInsert() and the save() function determines if it's calling an insert or an update based on the presence of clean data. When it doesn't find clean data (because _refresh() hasn't been called yet), it calls insert() (again), which calls _postUpdate() (again), which creates an infinite loop.

You can fix the problem by manually calling _refresh() from within _postUpdate() before a save() is called, but I suspect any developer who runs into this issue will spend a few hours cursing before he figures that out.

It should be fixed.


Posted by Scott Hovestadt (scott.hovestadt) on 2010-04-14T00:30:15.000+0000…

Posted by John Boehr (jboehr) on 2011-02-03T13:50:02.000+0000

I'm also having this issue.

Posted by John Boehr (jboehr) on 2011-02-03T13:58:43.000+0000

I can't think of any case where it would cause a problem (off the top of my head), but maybe you could move the _postInsert() call to after the _refresh() call?

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.