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

This commit is contained in:
skodak
2007-03-22 22:43:22 +00:00
parent 9e6f284ae6
commit 9ba5cf85e0
+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\">";