Reputation: 63
I am not sure what is going on with this particular page. When I view the page with debug set to 2 as long as I have some debug in the model it works, shows all the debug stuff as well as the finished product. As soon as I change the debug to 0 it just gives me a blank screen. view source shows that it has the html tags and nothing else.
Also, if debug is set to 2 and I am not debugging anything in my model it gives me a blank screen. The funny thing is I can tell that the code in my model is working because the code creates a temp table in which I populate get the information from the new table and then delete the table. I know it works because I can comment out the delete portion and the table is there with all the data like I would expect, so the table is getting created. When I uncomment the delete portion of the code the table is not there so I know that I am getting as far as that part of the code.
The next thing in my controller is to compact this data and get it ready for the view.
Anyone know what I can do to get this to work. It is baffling me to no end and I don't know what else to do.
Thanks for any help. Jamie
Upvotes: 2
Views: 272
Reputation: 5738
In my opinion it's a bug, if I disable the debug mode (switch to production), all calls to debug methods should be ignored, but apparently they aren't, see below.
I had calls like this (scatterer throughout the code):
CakeLog::write('debug', Debugger::trace());
that generated this error (after setting error_reporting(-1)
)
PHP Fatal error: Class 'CakeLog' not found in ...
or
PHP Fatal error: Class 'Debugger' not found in ...
After removing those I found out it failed at the compact function in the model (without any error in the log).
$this->find('first', compact('conditions', 'fields', 'order', 'recursive'))
As this question is old I don't think will actually of any use to you, but maybe it will help somebody else.
I'm using CakePHP 1.3.14.
Upvotes: 0
Reputation: 4856
CakePHP provides 3 debug levels - two for development and one for production setups. At debug = 0 the appliation is in production mode the following development functionality is disabled:
Debug messages, created with pr() and debug() are disabled. Core CakePHP caches are flushed every 99 years (this is a setting), instead of every 10 seconds as in development. Error views are less informative, and give generic error messages instead. Errors are not displayed. Exception stack traces are disabled. In addition to the above, many plugins and application extensions use debug to modify their behavior.
At level 1 (debug = 1) all the above functionalities are enabled, but chancing isn't flushed as frequently as when in debug = 2.
Either I do not understand your question or you are not asking it right. Debug levels are related to output from pr() and debug(), but no to the Controller's rendering of layouts and views.
Upvotes: 1