[TYPO3-core] bugreport about hooks, $this, tcemain infinite loops
Kasper Skårhøj
kasper2007 at typo3.com
Wed May 23 16:48:37 CEST 2007
Hi Folks,
Today I had the pleasure of putting out a bit-fire at Dassault
Systemes in Paris. I think the bug and solution might interest you
because it's one of those weird cases that experts like us love to
solve with our instincts. So I have attached the bug description
details and here I post the symptons so you can quickly see what the
main issue was and the lesson we learned from it:
-----------
Symptoms: When copying a page, TYPO3 would loop infinitely making
multiple copies of the
page until the apache process timed out. This could result in
hundreds of pages.
Lesson learned:
When setting up hooks it is quite natural to find the hook call in
the core and then copy/paste the
hook function call as a template for the function in the hook class
you are going to create. The
danger is that if the parent (caller) object, $this, is passed along
you may forget to rename it to -
typically - &$pObj. And as this case shows it will not yield an error
message and may induce a
puzzling problem to solve later. Remember to rename “$this” to “&
$pObj” when using hooks!
-----------

- kasper
----------------------------
NOTICE: NEW EMAIL for 2007: kasper2007 at typo3.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070523/b6f159f5/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bugreport 23 maj.pdf
Type: application/pdf
Size: 86982 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070523/b6f159f5/attachment-0001.pdf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070523/b6f159f5/attachment-0001.html
More information about the TYPO3-team-core
mailing list