mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-76509-master' of https://github.com/safatshahin/moodle
This commit is contained in:
commit
c198147268
@ -2332,10 +2332,16 @@ privatefiles,moodle|/user/files.php';
|
||||
$runinsert = function (int $lastslot, array $tagstrings) use ($DB) {
|
||||
$conditiondata = $DB->get_field('question_set_references', 'filtercondition',
|
||||
['itemid' => $lastslot, 'component' => 'mod_quiz', 'questionarea' => 'slot']);
|
||||
$condition = json_decode($conditiondata);
|
||||
$condition->tags = $tagstrings;
|
||||
$DB->set_field('question_set_references', 'filtercondition', json_encode($condition),
|
||||
['itemid' => $lastslot, 'component' => 'mod_quiz', 'questionarea' => 'slot']);
|
||||
|
||||
// It is possible to have leftover tags in the database, without a corresponding
|
||||
// slot, because of an old bugs (e.g. MDL-76193). Therefore, if the slot is not found,
|
||||
// we can safely discard these tags.
|
||||
if (!empty($conditiondata)) {
|
||||
$condition = json_decode($conditiondata);
|
||||
$condition->tags = $tagstrings;
|
||||
$DB->set_field('question_set_references', 'filtercondition', json_encode($condition),
|
||||
['itemid' => $lastslot, 'component' => 'mod_quiz', 'questionarea' => 'slot']);
|
||||
}
|
||||
};
|
||||
|
||||
foreach ($slottags as $tag) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user