From 7dbe6ceb4bb1bee43f77838d124aed1f85724d09 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 22 Mar 2007 22:45:02 +0000 Subject: [PATCH] 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 --- mod/glossary/editcategories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index ed303861e6..140119406d 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -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 "

" . get_string("add"). " " . get_string("category","glossary") . ""; -- 2.39.5