From: skodak Date: Thu, 22 Mar 2007 22:45:02 +0000 (+0000) Subject: MDL-8347 Cannot create new glossary category if category with same name exists in... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7dbe6ceb4bb1bee43f77838d124aed1f85724d09;p=moodle.git 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 --- 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") . "";