mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-25418 glossary - fix incorrect LOWER() call also present in glossary import & entry export functionalities
This commit is contained in:
parent
fda6946eb2
commit
20d3bf6100
@ -69,7 +69,10 @@ $entryalreadyexist = get_string('entryalreadyexist','glossary');
|
|||||||
$entryexported = get_string('entryexported','glossary');
|
$entryexported = get_string('entryexported','glossary');
|
||||||
|
|
||||||
if (!$mainglossary->allowduplicatedentries) {
|
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_title(format_string($glossary->name));
|
||||||
$PAGE->set_heading($course->fullname);
|
$PAGE->set_heading($course->fullname);
|
||||||
echo $OUTPUT->header();
|
echo $OUTPUT->header();
|
||||||
|
@ -204,9 +204,15 @@ if ($xml = glossary_read_imported_file($result)) {
|
|||||||
if ( !$glossary->allowduplicatedentries ) {
|
if ( !$glossary->allowduplicatedentries ) {
|
||||||
// checking if the entry is valid (checking if it is duplicated when should not be)
|
// checking if the entry is valid (checking if it is duplicated when should not be)
|
||||||
if ( $newentry->casesensitive ) {
|
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 {
|
} 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) {
|
if ($dupentry) {
|
||||||
$permissiongranted = 0;
|
$permissiongranted = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user