MDL-27820 backup - fix backup of ratings
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 15 Jun 2011 09:01:41 +0000 (11:01 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 15 Jun 2011 09:01:41 +0000 (11:01 +0200)
mod/data/backup/moodle2/backup_data_stepslib.php
mod/forum/backup/moodle2/backup_forum_stepslib.php
mod/glossary/backup/moodle2/backup_glossary_stepslib.php

index 5a155bd..2a811bc 100644 (file)
@@ -101,8 +101,8 @@ class backup_data_activity_structure_step extends backup_activity_structure_step
 
             $rating->set_source_table('rating', array('contextid'  => backup::VAR_CONTEXTID,
                                                       'itemid'     => backup::VAR_PARENTID,
-                                                      'component'  => 'mod_data',
-                                                      'ratingarea' => 'entry'));
+                                                      'component'  => backup_helper::is_sqlparam('mod_data'),
+                                                      'ratingarea' => backup_helper::is_sqlparam('entry')));
             $rating->set_source_alias('rating', 'value');
         }
 
index f9c1bc4..8a1e90d 100644 (file)
@@ -126,8 +126,8 @@ class backup_forum_activity_structure_step extends backup_activity_structure_ste
             $track->set_source_table('forum_track_prefs', array('forumid' => backup::VAR_PARENTID));
 
             $rating->set_source_table('rating', array('contextid'  => backup::VAR_CONTEXTID,
-                                                      'component'  => 'mod_forum',
-                                                      'ratingarea' => 'post',
+                                                      'component'  => backup_helper::is_sqlparam('mod_forum'),
+                                                      'ratingarea' => backup_helper::is_sqlparam('post'),
                                                       'itemid'     => backup::VAR_PARENTID));
             $rating->set_source_alias('rating', 'value');
         }
index 20b6328..b8d78ed 100644 (file)
@@ -103,8 +103,8 @@ class backup_glossary_activity_structure_step extends backup_activity_structure_
 
             $rating->set_source_table('rating', array('contextid'  => backup::VAR_CONTEXTID,
                                                       'itemid'     => backup::VAR_PARENTID,
-                                                      'component'  => 'mod_glossary',
-                                                      'ratingarea' => 'entry'));
+                                                      'component'  => backup_helper::is_sqlparam('mod_glossary'),
+                                                      'ratingarea' => backup_helper::is_sqlparam('entry')));
             $rating->set_source_alias('rating', 'value');
 
             $categoryentry->set_source_table('glossary_entries_categories', array('categoryid' => backup::VAR_PARENTID));