Variables in exception messages - xaraya/core GitHub Wiki

A common error that can occur in development is the case where a template contains a variable that was not set previously in PHP code. An exception will then be thrown (the code is in lib/xaraya/exceptions/handlers.php) and normally, Xaraya will attempt to print out all the available variables. In many cases, particularly where dataobjects are involved, this will result in the available memory being used up, which suppresses the desired exception message.

In the future perhaps a more elegant solution will be found. For now we have added a switch (as a configvar) to the themes backend that enables or disables the display of variables (default is to disable). The switch is a checkbox in the themes backend under "Debug Options".

For installs after August 1, 2017 this feature is already included.

For older installs upgrading to the latest code, the following SQL needs to be executed in phpMyAdmin on your database:

INSERT INTO `xar_module_vars` (`module_id`, `name`, `value`) VALUES (NULL, 'Site.BL.ExceptionDisplay', 'i:0;');