Bug #6170 - Glossary bug: it displays nothing when autolinking to non-ascii text and other minor cleanup
This commit is contained in:
@@ -31,9 +31,9 @@ if (! $glossary = get_record("glossary", "id", $cm->instance)) {
|
||||
}
|
||||
|
||||
if ($CFG->dbtype == 'postgres7' ) {
|
||||
$ucase = 'lower';
|
||||
$lcase = 'lower';
|
||||
} else {
|
||||
$ucase = 'lcase';
|
||||
$lcase = 'lcase';
|
||||
}
|
||||
|
||||
if (!$glossary->studentcanpost && !isteacher($glossary->course)) {
|
||||
@@ -132,7 +132,7 @@ if ( $confirm ) {
|
||||
|
||||
$permissiongranted = 1;
|
||||
if ( !$glossary->allowduplicatedentries ) {
|
||||
if ($dupentries = get_records("glossary_entries","$ucase(concept)", moodle_strtolower($newentry->concept))) {
|
||||
if ($dupentries = get_records("glossary_entries","$lcase(concept)", moodle_strtolower($newentry->concept))) {
|
||||
foreach ($dupentries as $curentry) {
|
||||
if ( $glossary->id == $curentry->glossaryid ) {
|
||||
if ( $curentry->id != $e ) {
|
||||
@@ -172,7 +172,7 @@ if ( $confirm ) {
|
||||
|
||||
$permissiongranted = 1;
|
||||
if ( !$glossary->allowduplicatedentries ) {
|
||||
if ($dupentries = get_record("glossary_entries","$ucase(concept)", moodle_strtolower($newentry->concept), "glossaryid", $glossary->id)) {
|
||||
if ($dupentries = get_record("glossary_entries","$lcase(concept)", moodle_strtolower($newentry->concept), "glossaryid", $glossary->id)) {
|
||||
$permissiongranted = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
}
|
||||
|
||||
if ($CFG->dbtype == 'postgres7' ) {
|
||||
$ucase = 'lower';
|
||||
$lcase = 'lower';
|
||||
} else {
|
||||
$ucase = 'lcase';
|
||||
$lcase = 'lcase';
|
||||
}
|
||||
|
||||
if ( !isteacher($cm->course) ) {
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
} else {
|
||||
if ( ! $mainglossary->allowduplicatedentries ) {
|
||||
$dupentry = get_record('glossary_entries','glossaryid', $mainglossary->id, $ucase.'(concept)',moodle_strtolower(addslashes($entry->concept)));
|
||||
$dupentry = get_record('glossary_entries','glossaryid', $mainglossary->id, $lcase.'(concept)',moodle_strtolower(addslashes($entry->concept)));
|
||||
if ( $dupentry ) {
|
||||
$PermissionGranted = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user