Index: exportentry.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/glossary/exportentry.php,v retrieving revision 1.47 diff -u -r1.47 exportentry.php --- exportentry.php 21 Sep 2010 08:37:36 -0000 1.47 +++ exportentry.php 9 Dec 2010 19:35:22 -0000 @@ -69,7 +69,10 @@ $entryexported = get_string('entryexported','glossary'); if (!$mainglossary->allowduplicatedentries) { - if ($DB->get_record('glossary_entries', array('glossaryid'=>$mainglossary->id, 'lower(concept)'=>moodle_strtolower($entry->concept)))) { + if ($DB->record_exists_select('glossary_entries', + 'glossaryid = :glossaryid AND LOWER(concept) = :concept', array( + 'glossaryid' => $mainglossary->id, + 'concept' => moodle_strtolower($entry->concept)))) { $PAGE->set_title(format_string($glossary->name)); $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); Index: import.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/glossary/import.php,v retrieving revision 1.71 diff -u -r1.71 import.php --- import.php 21 Sep 2010 08:54:02 -0000 1.71 +++ import.php 9 Dec 2010 19:35:22 -0000 @@ -204,9 +204,15 @@ if ( !$glossary->allowduplicatedentries ) { // checking if the entry is valid (checking if it is duplicated when should not be) if ( $newentry->casesensitive ) { - $dupentry = $DB->get_record("glossary_entries", array("concept"=>$newentry->concept, "glossaryid"=>$glossary->id)); + $dupentry = $DB->record_exists_select('glossary_entries', + 'glossaryid = :glossaryid AND concept = :concept', array( + 'glossaryid' => $glossary->id, + 'concept' => $newentry->concept)); } else { - $dupentry = $DB->get_record("glossary_entries", array("lower(concept)"=>moodle_strtolower($newentry->concept), "glossaryid"=>$glossary->id)); + $dupentry = $DB->record_exists_select('glossary_entries', + 'glossaryid = :glossaryid AND LOWER(concept) = :concept', array( + 'glossaryid' => $glossary->id, + 'concept' => moodle_strtolower($newentry->concept))); } if ($dupentry) { $permissiongranted = 0;