some bug fixes

This commit is contained in:
toyomoyo 2006-01-12 02:39:13 +00:00
parent dc1acc9bcb
commit 7c5406967d
14 changed files with 141 additions and 47 deletions

View File

@ -2,7 +2,7 @@
<TABLES>
<TABLE name="backup_config">
<FIELDS>
<FIELD name="name" method="NO_CONV" type="varchar" length="255" />
<FIELD name="name" method="NO_CONV" type="varchar" length="255" dropindex="name" adduniqueindex="name (name(255))"/>
<FIELD name="value" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
@ -13,13 +13,13 @@
</TABLE>
<TABLE name="backup_files">
<FIELDS>
<FIELD name="file_type" method="NO_CONV" type="varchar" length="10" />
<FIELD name="path" method="NO_CONV" type="varchar" length="255" />
<FIELD name="file_type" method="NO_CONV" type="varchar" length="10" dropprimary="true" />
<FIELD name="path" method="NO_CONV" type="varchar" length="255" addprimary="(backup_code, file_type(10), path(255))"/>
</FIELDS>
</TABLE>
<TABLE name="backup_ids">
<FIELDS>
<FIELD name="table_name" method="NO_CONV" type="varchar" length="30" />
<FIELD name="table_name" method="NO_CONV" type="varchar" length="30" dropprimary="true" addprimary="(backup_code, table_name(30), old_id)"/>
<FIELD name="info" method="PHP_FUNCTION" type="varchar" length="255">
<PHP_FUNCTION>
migrate2utf8_bckup_ids_info(RECORDID)

View File

@ -147,8 +147,8 @@ function migrate2utf8_course_sections_summary($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($coursesection->course); //Non existing!
$userlang = get_main_teacher_lang($coursesection->course); //N.E.!!
$courselang = get_course_lang($coursesections->course); //Non existing!
$userlang = get_main_teacher_lang($coursesections->course); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -932,8 +932,8 @@ function migrate2utf8_course_password($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -965,8 +965,8 @@ function migrate2utf8_course_fullname($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -998,8 +998,8 @@ function migrate2utf8_course_shortname($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1031,8 +1031,8 @@ function migrate2utf8_course_idnumber($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1064,8 +1064,8 @@ function migrate2utf8_course_summary($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1102,8 +1102,8 @@ function migrate2utf8_course_teacher($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1135,8 +1135,8 @@ function migrate2utf8_course_teachers($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1168,8 +1168,8 @@ function migrate2utf8_course_student($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1201,8 +1201,8 @@ function migrate2utf8_course_students($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
@ -1234,8 +1234,8 @@ function migrate2utf8_course_cost($recordid){
}
$sitelang = $CFG->lang;
$courselang = get_course_lang($course->course); //Non existing!
$userlang = get_main_teacher_lang($course->course); //N.E.!!
$courselang = get_course_lang($course->id); //Non existing!
$userlang = get_main_teacher_lang($course->id); //N.E.!!
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);

View File

@ -1,5 +1,13 @@
<DBMIGRATION type="lib" VERSION="2005120100">
<TABLES>
<TABLE name="adodb_logsql">
<FIELDS>
<FIELD name="sql0" method="NO_CONV" type="varchar" length="250" />
<FIELD name="sql1" method="NO_CONV" type="text" length="0" />
<FIELD name="params" method="NO_CONV" type="text" length="0" />
<FIELD name="tracer" method="NO_CONV" type="text" length="0" />
</FIELDS>
</TABLE>
<TABLE name="config">
<FIELDS>
<FIELD name="name" method="NO_CONV" type="varchar" length="255" dropindex="name" adduniqueindex="name (name(255))"/>
@ -21,6 +29,10 @@
</FIELD>
</FIELDS>
</TABLE>
<TABLE name="course_allowed_modules" />
<TABLE name="course_display" />
<TABLE name="course_meta" />
<TABLE name="course_modules" />
<TABLE name="course_categories">
<FIELDS>
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
@ -33,6 +45,7 @@
migrate2utf8_course_categories_description(RECORDID)
</PHP_FUNCTION>
</FIELD>
<FIELD name="path" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
<TABLE name="course_sections">
@ -102,6 +115,7 @@
</FIELD>
<FIELD name="modulename" method="NO_CONV" type="varchar" length="20" />
<FIELD name="eventtype" method="NO_CONV" type="varchar" length="20" />
<FIELD name="uuid" method="NO_CONV" type="varchar" length="36" />
</FIELDS>
</TABLE>
<TABLE name="cache_filters">
@ -125,6 +139,10 @@
</FIELD>
</FIELDS>
</TABLE>
<TABLE name="grade_item" />
<TABLE name="grade_preferences" />
<TABLE name="grade_category" />
<TABLE name="grade_exceptions" />
<TABLE name="grade_letter">
<FIELDS>
<FIELD name="letter" method="PHP_FUNCTION" type="varchar" length="8">
@ -134,6 +152,7 @@
</FIELD>
</FIELDS>
</TABLE>
<TABLE name="groups_members" />
<TABLE name="groups">
<FIELDS>
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="254">
@ -186,6 +205,7 @@
<FIELD name="field" method="NO_CONV" type="varchar" length="40" />
</FIELDS>
</TABLE>
<TABLE name="message_contacts" />
<TABLE name="message">
<FIELDS>
<FIELD name="message" method="PHP_FUNCTION" type="text" length="0">
@ -251,6 +271,13 @@
</FIELD>
</FIELDS>
</TABLE>
<TABLE name="sessions">
<FIELDS>
<FIELD name="sesskey" method="NO_CONV" type="varchar" length="32" dropprimary="true" addprimary="(sesskey(32))"/>
<FIELD name="expireref " method="NO_CONV" type="varchar" length="64" />
<FIELD name="data" method="NO_CONV" type="text" length="0" />
</FIELDS>
</TABLE>
<TABLE name="timezone">
<FIELDS>
<FIELD name="name" method="NO_CONV" type="varchar" length="100" />
@ -281,6 +308,9 @@
<FIELD name="enrol" method="NO_CONV" type="varchar" length="20" dropindex="enrol" addindex="enrol(enrol(20))"/>
</FIELDS>
</TABLE>
<TABLE name="stats_daily" />
<TABLE name="stats_weekly" />
<TABLE name="stats_monthly" />
<TABLE name="stats_user_daily">
<FIELDS>
<FIELD name="stattype" method="NO_CONV" type="varchar" length="30" />
@ -302,6 +332,8 @@
<FIELD name="value" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
<TABLE name="user_admins" />
<TABLE name="user_coursecreators" />
<TABLE name="user">
<FIELDS>
<FIELD name="auth" method="NO_CONV" type="varchar" length="20"/>

View File

@ -1,5 +1,13 @@
<DBMIGRATION type="mod/chat" VERSION="2005120100">
<TABLES>
<TABLE name="chat_users">
<FIELDS>
<FIELD name="version" method="NO_CONV" type="varchar" length="16" />
<FIELD name="ip" method="NO_CONV" type="varchar" length="15" />
<FIELD name="sid" method="NO_CONV" type="varchar" length="32" />
<FIELD name="lang" method="NO_CONV" type="varchar" length="10" />
</FIELDS>
</TABLE>
<TABLE name="chat_messages">
<FIELDS>
<FIELD name="message" method="PLAIN_SQL_UPDATE" type="text" length="0">

View File

@ -23,5 +23,6 @@
</FIELD>
</FIELDS>
</TABLE>
<TABLE name="choice_answers" />
</TABLES>
</DBMIGRATION>

View File

@ -1,5 +1,7 @@
<DBMIGRATION type="mod/data" VERSION="2005120100">
<TABLES>
<TABLE name="data_ratings" />
<TABLE name="data_records" />
<TABLE name="data_comments">
<FIELDS>
<FIELD name="content" method="NO_CONV" type="text" length="0" />

View File

@ -1,5 +1,10 @@
<DBMIGRATION type="mod/forum" VERSION="2005120100">
<TABLES>
<TABLE name="forum_queue" />
<TABLE name="forum_ratings" />
<TABLE name="forum_read" />
<TABLE name="forum_subscriptions" />
<TABLE name="forum_track_prefs" />
<TABLE name="forum_discussions">
<FIELDS>
<FIELD name="name" method="PLAIN_SQL_UPDATE" type="varchar" length="255">

View File

@ -1,5 +1,7 @@
<DBMIGRATION type="mod/glossary" VERSION="2005120100">
<TABLES>
<TABLE name="glossary_entries_categories" />
<TABLE name="glossary_ratings" />
<TABLE name="glossary_entries">
<FIELDS>
<FIELD name="concept" method="PLAIN_SQL_UPDATE" type="varchar" length="255" dropindex="concept" addindex="concept (concept(255))">

View File

@ -1,5 +1,18 @@
<DBMIGRATION type="mod/hotpot" VERSION="2005120100">
<TABLES>
<TABLE name="hotpot_attempts" />
<TABLE name="hotpot_strings">
<FIELDS>
<FIELD name="string" method="NO_CONV" type="TEXT" length="0">
</FIELDS>
</TABLE>
<TABLE name="hotpot_responses">
<FIELDS>
<FIELD name="correct" method="NO_CONV" type="varchar" length="255">
<FIELD name="wrong" method="NO_CONV" type="varchar" length="255">
<FIELD name="ignored" method="NO_CONV" type="varchar" length="255">
</FIELDS>
</TABLE>
<TABLE name="hotpot_details">
<FIELDS>
<FIELD name="details" method="PLAIN_SQL_UPDATE" type="text" length="0">

View File

@ -1,5 +1,8 @@
<DBMIGRATION type="mod/lesson" VERSION="2005120100">
<TABLES>
<TABLE name="lesson_branch" />
<TABLE name="lesson_grades" />
<TABLE name="lesson_timer" />
<TABLE name="lesson_attempts">
<FIELDS>
<FIELD name="useranswer" method="PLAIN_SQL_UPDATE" type="text" length="0">
@ -63,7 +66,7 @@
</TABLE>
<TABLE name="lesson">
<FIELDS>
<FIELD name="name" method="PLAIN_SQL_UPDATE" type="varchar" length="255">
<FIELD name="name" method="PHP_FUNCTION" type="varchar" length="255">
<PHP_FUNCTION>
migrate2utf8_lesson_name(RECORDID)
</PHP_FUNCTION>

View File

@ -376,7 +376,7 @@ function migrate2utf8_quiz_categories_name($recordid){
}
$SQL = "SELECT qc.course
FROM {$CFG->prefix}quiz_categories qc,
FROM {$CFG->prefix}quiz_categories qc
WHERE qc.id = $recordid";
if (!$quiz = get_record_sql($SQL)) {
@ -418,7 +418,7 @@ function migrate2utf8_quiz_categories_info($recordid){
}
$SQL = "SELECT qc.course
FROM {$CFG->prefix}quiz_categories qc,
FROM {$CFG->prefix}quiz_categories qc
WHERE qc.id = $recordid";
if (!$quiz = get_record_sql($SQL)) {

View File

@ -1,5 +1,34 @@
<DBMIGRATION type="mod/quiz" VERSION="2005120100">
<TABLES>
<TABLE name="quiz_attemptonlast_datasets" />
<TABLE name="quiz_grades" />
<TABLE name="quiz_question_datasets" />
<TABLE name="quiz_question_instances" />
<TABLE name="quiz_question_versions" />
<TABLE name="quiz_randomsamatch" />
<TABLE name="quiz_truefalse" />
<TABLE name="quiz_rqp">
<FIELDS>
<FIELD name="format" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
<TABLE name="quiz_rqp_servers">
<FIELDS>
<FIELD name="url" method="NO_CONV" type="varchar" length="255" />
</FIELDS>
</TABLE>
<TABLE name="quiz_rqp_states">
<FIELDS>
<FIELD name="responses" method="NO_CONV" type="text" length="0" />
<FIELD name="persistent_data" method="NO_CONV" type="text" length="0" />
<FIELD name="template_vars" method="NO_CONV" type="text" length="0" />
</FIELDS>
</TABLE>
<TABLE name="quiz_rqp_types">
<FIELDS>
<FIELD name="name" method="NO_CONV" type="varchar" length="255" dropindex="name" adduniqueindex="name (name(255))"/>
</FIELDS>
</TABLE>
<TABLE name="quiz_shortanswer">
<FIELDS>
<FIELD name="answers" method="NO_CONV" type="text" length="0" />

View File

@ -1,5 +1,5 @@
<?
function migrate2utf_workshop_stockcomments_comments($recordid){
function migrate2utf8_workshop_stockcomments_comments($recordid){
global $CFG;
/// Some trivial checks
@ -14,12 +14,12 @@ function migrate2utf_workshop_stockcomments_comments($recordid){
WHERE w.id = ws.workshopid
AND ws.id = $recordid";
if (!$workshop = get_record_sql($SQL) {
if (!$workshop = get_record_sql($SQL)) {
log_the_problem_somewhere();
return false;
}
if (!$workshopstockcomments = get_record('workshop_stockcomments','id',$recordid) {
if (!$workshopstockcomments = get_record('workshop_stockcomments','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@ -43,7 +43,7 @@ function migrate2utf_workshop_stockcomments_comments($recordid){
return $result;
}
function migrate2utf_workshop_rubrics_description($recordid){
function migrate2utf8_workshop_rubrics_description($recordid){
global $CFG;
/// Some trivial checks
@ -58,12 +58,12 @@ function migrate2utf_workshop_rubrics_description($recordid){
WHERE w.id = ws.workshopid
AND ws.id = $recordid";
if (!$workshop = get_record_sql($SQL) {
if (!$workshop = get_record_sql($SQL)) {
log_the_problem_somewhere();
return false;
}
if (!$workshoprubrics = get_record('workshop_stockcomments','id',$recordid) {
if (!$workshoprubrics = get_record('workshop_stockcomments','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@ -87,7 +87,7 @@ function migrate2utf_workshop_rubrics_description($recordid){
return $result;
}
function migrate2utf_workshop_grades_feedback($recordid){
function migrate2utf8_workshop_grades_feedback($recordid){
global $CFG;
/// Some trivial checks
@ -102,12 +102,12 @@ function migrate2utf_workshop_grades_feedback($recordid){
WHERE w.id = wg.workshopid
AND wg.id = $recordid";
if (!$workshop = get_record_sql($SQL) {
if (!$workshop = get_record_sql($SQL)) {
log_the_problem_somewhere();
return false;
}
if (!$workshopgrades = get_record('workshop_grades','id',$recordid) {
if (!$workshopgrades = get_record('workshop_grades','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@ -131,7 +131,7 @@ function migrate2utf_workshop_grades_feedback($recordid){
return $result;
}
function migrate2utf_workshop_elements_description($recordid){
function migrate2utf8_workshop_elements_description($recordid){
global $CFG;
/// Some trivial checks
@ -146,12 +146,12 @@ function migrate2utf_workshop_elements_description($recordid){
WHERE w.id = we.workshopid
AND we.id = $recordid";
if (!$workshop = get_record_sql($SQL) {
if (!$workshop = get_record_sql($SQL)) {
log_the_problem_somewhere();
return false;
}
if (!$workshopelements = get_record('workshop_elements','id',$recordid) {
if (!$workshopelements = get_record('workshop_elements','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@ -175,7 +175,7 @@ function migrate2utf_workshop_elements_description($recordid){
return $result;
}
function migrate2utf_workshop_name($recordid){
function migrate2utf8_workshop_name($recordid){
global $CFG;
/// Some trivial checks
@ -184,7 +184,7 @@ function migrate2utf_workshop_name($recordid){
return false;
}
if (!$workshop = get_record('workshop','id',$recordid) {
if (!$workshop = get_record('workshop','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@ -208,7 +208,7 @@ function migrate2utf_workshop_name($recordid){
return $result;
}
function migrate2utf_workshop_description($recordid){
function migrate2utf8_workshop_description($recordid){
global $CFG;
/// Some trivial checks
@ -217,7 +217,7 @@ function migrate2utf_workshop_description($recordid){
return false;
}
if (!$workshop = get_record('workshop','id',$recordid) {
if (!$workshop = get_record('workshop','id',$recordid)) {
log_the_problem_somewhere();
return false;
}
@ -241,7 +241,7 @@ function migrate2utf_workshop_description($recordid){
return $result;
}
function migrate2utf_workshop_password($recordid){
function migrate2utf8_workshop_password($recordid){
global $CFG;
}
?>

View File

@ -44,7 +44,6 @@
<TABLE name="workshop_rubrics">
<FIELDS>
<FIELD name="description" method="PHP_FUNCTION" type="text" length="0">
<SQL_DETECT_COURSE>
<PHP_FUNCTION>
migrate2utf8_workshop_rubrics_description(RECORDID)
</PHP_FUNCTION>