Hi all,

I have an issue with rendering getting itself into an infinite loop.
I've stepped through the code I can see what's going on, but I don't
want to mess with the core given I don't have a good overview of how
it all fits together. I can consistently reproduce this problem by
doing one thing in my app - a post that adds a row to a database
table.
The odd thing is when I clear the CAKEPHP cookie the issue goes away -
as well as logging me out of my app (i'm using Auth).

Starting at Controller->render Cake renders the view, then it hits
line 347 of view.php (code below) and it skips through a bit more code
back to the start of Controller->render to render the layout. While
rendering the layout it gets back to that same line and again jumps
back to Controller->render to render the layout again - I can confirm
this is what I see in my web browser. The problem is it doesn't seem
to know it's rendering the layout, and it gets into a recursive loop.
One solution might be some kind of a flag to say "hey i'm rendering
the layout already, don't do it again", but it would probably be
better to work out why it does it than just adding a flag.

if ($layout && $this->autoLayout) {   // view.php line 347
  $out = $this->renderLayout($out, $layout);

I'm using Cake 1.2.0.6311-beta on Windows XP with the WAMP stack (PHP
5.2.5, mySql 5.0.45, Apache 2.2.6).

Any thoughts or help would be appreciated!

Tim

Here's what I see in my web browser.

( ! ) Fatal error: Maximum function nesting level of '100' reached,
aborting! in D:\Common\ApacheDocroot\cake\libs\debugger.php on line
143
Call Stack
#       Time    Function        Location
1       1.1219  {main}( )       ..\index.php:0
2       2.1623  Dispatcher->dispatch( ???, ??? )        ..\index.php:84
3       3.0177  Dispatcher->_invoke( ???, ???, ??? )    ..\dispatcher.php:240
** First infine loop iteration starts here **
4       3.0178  Controller->render( ???, ???, ??? )     ..\dispatcher.php:272
5       3.0156  View->render( ???, ???, ??? )   ..\controller.php:712
6       3.0992  View->renderLayout( ???, ??? )  ..\view.php:348
7       3.1013  View->_render( ???, ???, ???, ??? )     ..\view.php:448
8       3.1038  include( 'D:\Common\ApacheDocroot\testsite\views\layouts
\default.ctp' ) ..\view.php:648
9       3.1047  SessionHelper->flash( ??? )     ..\default.ctp:73
10      3.1054  View->renderLayout( ???, ??? )  ..\session.php:143
11      3.1054  View->_getLayoutFileName( ??? ) ..\view.php:416
12      3.1236  View->_missingView( ???, ??? )  ..\view.php:839
13      3.1273  Object->cakeError( ???, ??? )   ..\view.php:873
14      3.1344  ErrorHandler->__construct( ???, ??? )   ..\object.php:169
15      3.1403  call_user_func_array ( ???, ??? )       ..\error.php:90
16      3.1403  ErrorHandler->missingLayout( ??? )      ..\error.php:0
** Second iteration starts here **
17      3.1409  Controller->render( ???, ???, ??? )     ..\error.php:269
18      3.1414  View->render( ???, ???, ??? )   ..\controller.php:712
19      3.1555  View->renderLayout( ???, ??? )  ..\view.php:348
20      3.1406  View->_render( ???, ???, ???, ??? )     ..\view.php:448
21      3.1406  include( 'D:\Common\ApacheDocroot\testsite\views\layouts
\default.ctp' ) ..\view.php:648
22      3.1406  SessionHelper->flash( ??? )     ..\default.ctp:73
23      3.1406  View->renderLayout( ???, ??? )  ..\session.php:143
24      3.1406  View->_getLayoutFileName( ??? ) ..\view.php:416
25      3.1570  View->_missingView( ???, ??? )  ..\view.php:839
26      3.1605  Object->cakeError( ???, ??? )   ..\view.php:873
27      3.1605  ErrorHandler->__construct( ???, ??? )   ..\object.php:169
28      3.1613  call_user_func_array ( ???, ??? )       ..\error.php:90
29      3.1613  ErrorHandler->missingLayout( ??? )      ..\error.php:0
** Continues in this loop until shut down **
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to