]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8347 Cannot create new glossary category if category with same name exists in...
authorskodak <skodak>
Thu, 22 Mar 2007 22:45:02 +0000 (22:45 +0000)
committerskodak <skodak>
Thu, 22 Mar 2007 22:45:02 +0000 (22:45 +0000)
mod/glossary/editcategories.php

index ed303861e6cb2f6aeb549b4ba6f73b58eb0b47b4..140119406dfae176042b9f8e27943a58a3938be1 100644 (file)
     } 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\">";