mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-25227 glossary - fix delete_instance() and clean orphaned entries
This commit is contained in:
parent
f3cc571af2
commit
3b953472ac
3 changed files with 12 additions and 1 deletions
|
@ -299,6 +299,16 @@ function xmldb_glossary_upgrade($oldversion) {
|
|||
upgrade_mod_savepoint(true, 2010042800, 'glossary');
|
||||
}
|
||||
|
||||
if ($oldversion < 2010111500) {
|
||||
// Delete orphaned glossary_entries not belonging to any glossary (MDL-25227)
|
||||
$sql = "DELETE FROM {glossary_entries}
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 'x' FROM {glossary} g
|
||||
WHERE g.id = glossaryid)";
|
||||
$DB->execute($sql);
|
||||
|
||||
upgrade_mod_savepoint(true, 2010111500, 'glossary');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue