From d9f30321da9829b187252bfc2de39433c804362e Mon Sep 17 00:00:00 2001 From: dongsheng Date: Sun, 15 Jun 2008 11:07:51 +0000 Subject: [PATCH] "MDL-14129, fix print_error" --- lang/en_utf8/error.php | 2 ++ question/format.php | 2 +- question/format/xml/format.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index fa59f0b10b..72540a968a 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -27,6 +27,7 @@ $string['cannotsavedata'] = 'Cannot save data'; $string['cannotsaveagreement'] = 'Could not save your agreement'; $string['cannotcallscript'] = 'You cannot call this script in that way'; $string['cannotcreatebackupdir'] = 'Could not create backupdata folder. The site administrator needs to fix the file permissions'; +$string['cannotcreatecategory'] = 'The category was not inserted.'; $string['cannotcreatedefaultcat'] = 'Error creating a default category for context $a'; $string['cannotcreategroup'] = 'Error creating group'; $string['cannotcreatelangdir'] = 'Cannot create lang dir.'; @@ -382,6 +383,7 @@ $string['unknownrole'] = 'Unknown role \"$a\"'; $string['unknownuseraction'] = 'Sorry, I do not understand this user action.'; $string['unknoworder'] = 'Unknown ordering'; $string['unknowparamtype'] = 'Unknown parameter type: $a'; +$string['unknowquestiontype'] = 'Unsupported question type $a'; $string['unknowuploadaction'] = 'Error: Unknow upload action ($a).'; $string['unsupportedevent'] = 'Unsupported event type'; $string['upgraderequires19'] = 'ERROR: New Moodle version was installed on server, unfortunately upgrade from the previous version is not supported.
Please upgrade first to latest 1.9.x release. You can also return to previous version by reinstalling original files.'; diff --git a/question/format.php b/question/format.php index e6865264f6..1ec5ad46e1 100644 --- a/question/format.php +++ b/question/format.php @@ -385,7 +385,7 @@ class qformat_default { $category->sortorder = 999; $category->stamp = make_unique_id_code(); if (!($id = $DB->insert_record('question_categories', $category))) { - print_error( "cannot create new category - $catname" ); + print_error("cannotcreatecategory"); } $category->id = $id; $parent = $id; diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 352fe5ab27..dd84da0dc8 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -1003,7 +1003,7 @@ class qformat_xml extends qformat_default { default: // try support by optional plugin if (!$data = $this->try_exporting_using_qtypes( $question->qtype, $question )) { - print_error( "Unsupported question type $question->qtype" ); + print_error('unknowquestiontype', '', '', $question->qtype ); } $expout .= $data; } -- 2.39.5