MDL-8347 Cannot create new glossary category if category with same name exists in another course on site; patch by Ray Lawrence; merged from MOODLE_18_STABLE

This commit is contained in:
skodak
2007-03-22 22:45:02 +00:00
parent 88495aa8d2
commit 7dbe6ceb4b
+1 -1
View File
@@ -131,7 +131,7 @@
} elseif ( $action == "add" ) {
if ( $confirm ) {
$ILIKE = sql_ilike();
$dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name'");
$dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name' AND glossaryid=$glossary->id");
if ( $dupcategory ) {
echo "<p align=\"center\">" . get_string("add"). " " . get_string("category","glossary") . "<font size=\"3\">";