From e639d0cca81b99669d5958fd8c8e08a14b41cea0 Mon Sep 17 00:00:00 2001 From: Andrew Robert Nicols Date: Wed, 18 Jan 2012 12:29:26 +0000 Subject: [PATCH] MDL-31242 Prevent redefinition of MOODLE_INTERNAL when loading multiple YUI modules from Moodle --- theme/yui_combo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/theme/yui_combo.php b/theme/yui_combo.php index 209f54f15b220..1c332597772a2 100644 --- a/theme/yui_combo.php +++ b/theme/yui_combo.php @@ -74,8 +74,10 @@ $version = array_shift($bits); if ($version == 'moodle') { //TODO: this is a ugly hack because we should not load any libs here! - define('MOODLE_INTERNAL', true); - require_once($CFG->libdir.'/moodlelib.php'); + if (!defined('MOODLE_INTERNAL')) { + define('MOODLE_INTERNAL', true); + require_once($CFG->libdir.'/moodlelib.php'); + } $revision = (int)array_shift($bits); if ($revision === -1) { // Revision -1 says please don't cache the JS