From 2d3522ae1ef35999951970caec9f6f9bb6724b4e Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Sun, 18 Jul 2010 12:30:49 +0000 Subject: [PATCH] NOMDL Fixed incorrect throwing of exceptions - missing 'new' or unknown exception class --- backup/moodle2/backup_activity_task.class.php | 4 ++-- backup/moodle2/backup_block_task.class.php | 2 +- backup/moodle2/backup_section_task.class.php | 2 +- backup/util/loggers/simpletest/testlogger.php | 2 +- backup/util/plan/simpletest/teststep.php | 2 +- backup/util/xml/output/simpletest/testoutput.php | 2 +- enrol/manual/manage.php | 2 +- mod/workshop/form/accumulative/lib.php | 2 +- mod/workshop/form/comments/lib.php | 2 +- mod/workshop/form/numerrors/lib.php | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backup/moodle2/backup_activity_task.class.php b/backup/moodle2/backup_activity_task.class.php index 2eb3433a5e8..2b0d361b129 100644 --- a/backup/moodle2/backup_activity_task.class.php +++ b/backup/moodle2/backup_activity_task.class.php @@ -43,11 +43,11 @@ abstract class backup_activity_task extends backup_task { // Check moduleid exists if (!$coursemodule = get_coursemodule_from_id(false, $moduleid)) { - throw backup_task_exception('activity_task_coursemodule_not_found', $moduleid); + throw new backup_task_exception('activity_task_coursemodule_not_found', $moduleid); } // Check activity supports this moodle2 backup format if (!plugin_supports('mod', $coursemodule->modname, FEATURE_BACKUP_MOODLE2)) { - throw backup_task_exception('activity_task_activity_lacks_moodle2_backup_support', $coursemodule->modname); + throw new backup_task_exception('activity_task_activity_lacks_moodle2_backup_support', $coursemodule->modname); } $this->moduleid = $moduleid; diff --git a/backup/moodle2/backup_block_task.class.php b/backup/moodle2/backup_block_task.class.php index 2e8f0a39cb3..8358a5b56fb 100644 --- a/backup/moodle2/backup_block_task.class.php +++ b/backup/moodle2/backup_block_task.class.php @@ -45,7 +45,7 @@ abstract class backup_block_task extends backup_task { // Check blockid exists if (!$block = $DB->get_record('block_instances', array('id' => $blockid))) { - throw backup_task_exception('block_task_block_instance_not_found', $blockid); + throw new backup_task_exception('block_task_block_instance_not_found', $blockid); } $this->blockid = $blockid; diff --git a/backup/moodle2/backup_section_task.class.php b/backup/moodle2/backup_section_task.class.php index 8c5b64d52ed..11d49df3c58 100644 --- a/backup/moodle2/backup_section_task.class.php +++ b/backup/moodle2/backup_section_task.class.php @@ -40,7 +40,7 @@ class backup_section_task extends backup_task { // Check section exists if (!$section = $DB->get_record('course_sections', array('id' => $sectionid))) { - throw backup_task_exception('section_task_section_not_found', $sectionid); + throw new backup_task_exception('section_task_section_not_found', $sectionid); } $this->sectionid = $sectionid; diff --git a/backup/util/loggers/simpletest/testlogger.php b/backup/util/loggers/simpletest/testlogger.php index 01e1d280485..cbd11fb8808 100644 --- a/backup/util/loggers/simpletest/testlogger.php +++ b/backup/util/loggers/simpletest/testlogger.php @@ -235,7 +235,7 @@ class logger_test extends UnitTestCase { @remove_dir(dirname($file)); // Recreate test dir if (!check_dir_exists(dirname($file), true, true)) { - throw moodle_exception('error_creating_temp_dir', 'error', dirname($file)); + throw new moodle_exception('error_creating_temp_dir', 'error', dirname($file)); } // Instantiate with date and level output, and also use the depth option diff --git a/backup/util/plan/simpletest/teststep.php b/backup/util/plan/simpletest/teststep.php index e66aca64af6..0e0b567a0a2 100644 --- a/backup/util/plan/simpletest/teststep.php +++ b/backup/util/plan/simpletest/teststep.php @@ -200,7 +200,7 @@ class backup_step_test extends UnitTestCase { @remove_dir(dirname($file)); // Recreate test dir if (!check_dir_exists(dirname($file), true, true)) { - throw moodle_exception('error_creating_temp_dir', 'error', dirname($file)); + throw new moodle_exception('error_creating_temp_dir', 'error', dirname($file)); } // We need one (non interactive) controller for instatiating plan diff --git a/backup/util/xml/output/simpletest/testoutput.php b/backup/util/xml/output/simpletest/testoutput.php index 60de382c458..a1d6bad675c 100644 --- a/backup/util/xml/output/simpletest/testoutput.php +++ b/backup/util/xml/output/simpletest/testoutput.php @@ -224,7 +224,7 @@ class xml_output_test extends UnitTestCase { @remove_dir(dirname($file)); // Recreate test dir if (!check_dir_exists(dirname($file), true, true)) { - throw moodle_exception('error_creating_temp_dir', 'error', dirname($file)); + throw new moodle_exception('error_creating_temp_dir', 'error', dirname($file)); } // Instantiate xml_output diff --git a/enrol/manual/manage.php b/enrol/manual/manage.php index 4b8bd0409dc..eb091793d1d 100644 --- a/enrol/manual/manage.php +++ b/enrol/manual/manage.php @@ -52,7 +52,7 @@ if (!isset($roles[$roleid])) { } if (!$enrol_manual = enrol_get_plugin('manual')) { - throw coding_error('Can not instantiate enrol_manual'); + throw new coding_exception('Can not instantiate enrol_manual'); } $instancename = $enrol_manual->get_instance_name($instance); diff --git a/mod/workshop/form/accumulative/lib.php b/mod/workshop/form/accumulative/lib.php index 0e0f3145cc7..2408dc3fd5c 100644 --- a/mod/workshop/form/accumulative/lib.php +++ b/mod/workshop/form/accumulative/lib.php @@ -245,7 +245,7 @@ class workshop_accumulative_strategy implements workshop_strategy { global $DB; if (!isset($data->nodims)) { - throw coding_expection('You did not send me the number of assessment dimensions to process'); + throw new coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { $grade = new stdclass(); diff --git a/mod/workshop/form/comments/lib.php b/mod/workshop/form/comments/lib.php index 85be3d1f026..ec0cb780596 100644 --- a/mod/workshop/form/comments/lib.php +++ b/mod/workshop/form/comments/lib.php @@ -244,7 +244,7 @@ class workshop_comments_strategy implements workshop_strategy { global $DB; if (!isset($data->nodims)) { - throw coding_expection('You did not send me the number of assessment dimensions to process'); + throw new coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { $grade = new stdclass(); diff --git a/mod/workshop/form/numerrors/lib.php b/mod/workshop/form/numerrors/lib.php index 38a4a1799cb..782cbb513f2 100644 --- a/mod/workshop/form/numerrors/lib.php +++ b/mod/workshop/form/numerrors/lib.php @@ -280,7 +280,7 @@ class workshop_numerrors_strategy implements workshop_strategy { global $DB; if (!isset($data->nodims)) { - throw coding_expection('You did not send me the number of assessment dimensions to process'); + throw new coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { $grade = new stdclass();