Moodle

Cannot create new glossary category if category with same name exists in another course on site

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.7.1
  • Fix Version/s: 1.7.2, 1.8
  • Component/s: Glossary
  • Labels:
    None
  • Environment:
    php 4.4.3, mYSQL 5.0.18
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE

Description

Cannot create new glossary category if category with same name exists in another course on site. If another name is chosen which does not already exist the category can be created without difficulty.

Activity

Hide
Gustavo Muneto added a comment -

the problem can be solved modifying the file editcategories.php located in mod/glossary.
Line 134.

original:
$dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name'");

new:
$dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name' and glossaryid=".$glossary->id);

Show
Gustavo Muneto added a comment - the problem can be solved modifying the file editcategories.php located in mod/glossary. Line 134. original: $dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name'"); new: $dupcategory = get_records_sql("SELECT * FROM {$CFG->prefix}glossary_categories WHERE name $ILIKE '$name' and glossaryid=".$glossary->id);
Hide
Petr Škoda (skodak) added a comment -

fixed in cvs, thanks for the report and patch!

Show
Petr Škoda (skodak) added a comment - fixed in cvs, thanks for the report and patch!
Hide
Ray Lawrence added a comment -

Excellent! Cheers, Petr.

Show
Ray Lawrence added a comment - Excellent! Cheers, Petr.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: