Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-31184 fix multiple problems when reseting individual glossary types

  • Loading branch information...
commit d8202baf04d4bff90af9a1046cf7fe18550fdf7c 1 parent 1aff7bb
Petr Skoda skodak authored

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 mod/glossary/lib.php
8 mod/glossary/lib.php
@@ -2531,8 +2531,8 @@ function glossary_reset_userdata($data) {
2531 2531 $status[] = array('component'=>$componentstr, 'item'=>get_string('resetglossariesall', 'glossary'), 'error'=>false);
2532 2532
2533 2533 } else if (!empty($data->reset_glossary_types)) {
2534   - $mainentriessql = "$allentries AND g.mainglossary=1";
2535   - $secondaryentriessql = "$allentries AND g.mainglossary=0";
  2534 + $mainentriessql = "$allentriessql AND g.mainglossary=1";
  2535 + $secondaryentriessql = "$allentriessql AND g.mainglossary=0";
2536 2536
2537 2537 $mainglossariessql = "$allglossariessql AND g.mainglossary=1";
2538 2538 $secondaryglossariessql = "$allglossariessql AND g.mainglossary=0";
@@ -2561,14 +2561,14 @@ function glossary_reset_userdata($data) {
2561 2561 glossary_reset_gradebook($data->courseid, 'main');
2562 2562 }
2563 2563
2564   - $status[] = array('component'=>$componentstr, 'item'=>get_string('resetglossaries', 'glossary'), 'error'=>false);
  2564 + $status[] = array('component'=>$componentstr, 'item'=>get_string('resetglossaries', 'glossary').': '.get_string('mainglossary', 'glossary'), 'error'=>false);
2565 2565
2566 2566 } else if (in_array('secondary', $data->reset_glossary_types)) {
2567 2567 $params[] = 'glossary_entry';
2568 2568 $DB->delete_records_select('comments', "itemid IN ($secondaryentriessql) AND commentarea=?", $params);
2569 2569 $DB->delete_records_select('glossary_entries', "glossaryid IN ($secondaryglossariessql)", $params);
2570 2570 // remove exported source flag from entries in main glossary
2571   - $DB->execute("UPDATE {glossary_entries
  2571 + $DB->execute("UPDATE {glossary_entries}
2572 2572 SET sourceglossaryid=0
2573 2573 WHERE glossaryid IN ($mainglossariessql)", $params);
2574 2574

0 comments on commit d8202ba

Please sign in to comment.
Something went wrong with that request. Please try again.