From 06d7352a0ae6a93969fc502c8bbe079b4e80ea46 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Fri, 16 Mar 2018 18:47:02 +1100 Subject: [PATCH] MDL-61464 Backup: Include contextid for questuin tags --- backup/moodle2/backup_stepslib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index af22ff5cdea..a2f922a573d 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -2234,7 +2234,7 @@ class backup_questions_structure_step extends backup_structure_step { $tags = new backup_nested_element('tags'); - $tag = new backup_nested_element('tag', array('id'), array('name', 'rawname')); + $tag = new backup_nested_element('tag', array('id', 'contextid'), array('name', 'rawname')); // Build the tree @@ -2266,7 +2266,7 @@ class backup_questions_structure_step extends backup_structure_step { ORDER BY id', array('questionid' => backup::VAR_PARENTID)); - $tag->set_source_sql("SELECT t.id, t.name, t.rawname + $tag->set_source_sql("SELECT t.id, ti.contextid, t.name, t.rawname FROM {tag} t JOIN {tag_instance} ti ON ti.tagid = t.id WHERE ti.itemid = ?