MDL-40795 enable NO_DEBUG_DISPLAY in AJAX_SCRIPT by default

This should prevent some ajax problems in incorrectly configured production sites.

Note that developers need to learn to watch error logs all the time during development!
This commit is contained in:
Petr Škoda
2013-07-20 14:23:03 +02:00
parent ffc3f5308b
commit cb9ee2a953
+7 -1
View File
@@ -173,7 +173,13 @@ ini_set('precision', 14); // needed for upgrades and gradebook
// please note it must be defined before including the config.php script
// and in some cases you also need to set custom default exception handler
if (!defined('NO_DEBUG_DISPLAY')) {
define('NO_DEBUG_DISPLAY', false);
if (defined('AJAX_SCRIPT') and AJAX_SCRIPT) {
// Moodle AJAX scripts are expected to return json data, any PHP notices or errors break it badly,
// developers simply must learn to watch error log.
define('NO_DEBUG_DISPLAY', true);
} else {
define('NO_DEBUG_DISPLAY', false);
}
}
// Some scripts such as upgrade may want to prevent output buffering