Moodle
  1. Moodle
  2. MDL-25418

Error when try to add a new glossary entry

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: Glossary
    • Labels:
      None
    • Environment:
      Course of "Features Demo" at Moodle QA Testing site
    • Rank:
      1106

      Description

      When I try to add a new entry, in FAQ style glosary, at Moodle QA (as test teacher and student), I can edit it, but when I click "Save changes", it shows this

      Error: Field "LOWER(concept)" does not exist in table "glossary_entries" and : Stack trace:

      • line 508 of /lib/dml/moodle_database.php: dml_exception thrown
      • line 1207 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
      • line 124 of /mod/glossary/edit_form.php: call to moodle_database->get_record()
      • line 438 of /lib/formslib.php: call to mod_glossary_entry_form->validation()
      • line 397 of /lib/formslib.php: call to moodleform->validate_defined_fields()
      • line 484 of /lib/formslib.php: call to moodleform->is_validated()
      • line 88 of /mod/glossary/edit.php: call to moodleform->get_data()
      1. MDL-25418_import_export.patch.txt
        3 kB
        Eloy Lafuente (stronk7)
      2. MDL-25418.patch
        2 kB
        Lei Zhang
      3. MDL-25418.v2.patch
        3 kB
        Jason Ilicic

        Issue Links

          Activity

          Hide
          Kathy McFarland added a comment -

          Error: Field "LOWER(concept)" does not exist in table "glossary_entries" in live Moodle 2.0 site when entry to Glossary is made, or import is attempted

          Show
          Kathy McFarland added a comment - Error: Field "LOWER(concept)" does not exist in table "glossary_entries" in live Moodle 2.0 site when entry to Glossary is made, or import is attempted
          Hide
          Alexander Fedorov added a comment -

          How developers test this version and can named it "stable"??? There are a lot of warnings, bugs etc. I have the same bug in my 2-nd stable version. The same bug was in RC version. Where are changes??? Don't name version "stable" if it is not!

          Show
          Alexander Fedorov added a comment - How developers test this version and can named it "stable"??? There are a lot of warnings, bugs etc. I have the same bug in my 2-nd stable version. The same bug was in RC version. Where are changes??? Don't name version "stable" if it is not!
          Hide
          Mike Kimble added a comment -

          I'm also having the same problem. Something as simple as an entry gives me problems.

          Show
          Mike Kimble added a comment - I'm also having the same problem. Something as simple as an entry gives me problems.
          Hide
          Lei Zhang added a comment -

          What happened here was the condition array is looking for a field name called "LOWER(concept)" instead of having concept field converted to lower case. Removing the sql function should fix this error.

          Show
          Lei Zhang added a comment - What happened here was the condition array is looking for a field name called "LOWER(concept)" instead of having concept field converted to lower case. Removing the sql function should fix this error.
          Hide
          Joseph Rézeau added a comment -

          One reason why this bug has escaped QA tests in moodle 2.0 is that it only occurs if a glossary has been set to Duplicate entries allowed: No.
          See http://moodle.org/mod/forum/discuss.php?d=163215

          Show
          Joseph Rézeau added a comment - One reason why this bug has escaped QA tests in moodle 2.0 is that it only occurs if a glossary has been set to Duplicate entries allowed: No . See http://moodle.org/mod/forum/discuss.php?d=163215
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Done.

          The problem has been there since 2008, when the change to the new DB API was done. Horrible it has been dormant since then, grrr.

          Thanks for the report and comments (but to sannek's unconstructive one, of course)

          Fix is available @ CVS/GIT and will be included in next build of 2.0, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Done. The problem has been there since 2008, when the change to the new DB API was done. Horrible it has been dormant since then, grrr. Thanks for the report and comments (but to sannek's unconstructive one, of course) Fix is available @ CVS/GIT and will be included in next build of 2.0, ciao
          Hide
          Jason Ilicic added a comment -

          Still cannot import files due to the LOWER(concept) field not being found. This appears to be a bug due to a change in the DML where it checks that the parameter received is a real field, so it returns an error saying the field does not exist. This can be fixed by using get_record_sql() instead of get_record() as applied in version 2 of the patch.

          Show
          Jason Ilicic added a comment - Still cannot import files due to the LOWER(concept) field not being found. This appears to be a bug due to a change in the DML where it checks that the parameter received is a real field, so it returns an error saying the field does not exist. This can be fixed by using get_record_sql() instead of get_record() as applied in version 2 of the patch.
          Hide
          Joseph Rézeau added a comment -

          Jason is right... the issue is not completely fixed.
          It is fixed for adding new entry in glossary, but not fixed when importing glossary entries into a glossary which is set as "Duplicate entries allowed NO".
          Joseph

          Show
          Joseph Rézeau added a comment - Jason is right... the issue is not completely fixed. It is fixed for adding new entry in glossary, but not fixed when importing glossary entries into a glossary which is set as "Duplicate entries allowed NO". Joseph
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Aha,

          I remember myself looking for more LOWER() uses in the glossary filter when I initially fixed this. But it seems that I left out this two (surely I searched for uppercase only, grrr):

          • exportentry.php
          • import.php

          Going to fix both asap, thanks Jason, Joseph!

          PD: Are you able to reopen issues? Just for curiosity.

          Show
          Eloy Lafuente (stronk7) added a comment - Aha, I remember myself looking for more LOWER() uses in the glossary filter when I initially fixed this. But it seems that I left out this two (surely I searched for uppercase only, grrr): exportentry.php import.php Going to fix both asap, thanks Jason, Joseph! PD: Are you able to reopen issues? Just for curiosity.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Attaching MDL-25418_import_export.patch that should fix both import and exportentry.

          Can you test it, plz. I'll do it in a couple of hours if you can't.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Attaching MDL-25418 _import_export.patch that should fix both import and exportentry. Can you test it, plz. I'll do it in a couple of hours if you can't. TIA and ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Reopening to get it tracked here.

          Show
          Eloy Lafuente (stronk7) added a comment - Reopening to get it tracked here.
          Hide
          Joseph Rézeau added a comment -

          Tested patch :: works OK for me.
          Thanks,
          Joseph
          PS. I don't think we can re-open issues in the new-look tracker (if we are not the original poster or do not have "special rights"?

          Show
          Joseph Rézeau added a comment - Tested patch :: works OK for me. Thanks, Joseph PS. I don't think we can re-open issues in the new-look tracker (if we are not the original poster or do not have "special rights"?
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Thanks Joseph,

          I'm committing the patch right now, will be available via cvs/git or in next Moodle 2.0+ weekly build.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Thanks Joseph, I'm committing the patch right now, will be available via cvs/git or in next Moodle 2.0+ weekly build. Ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          re-resolving this as fixed, I haven't found more place where the old (incorrect) lower() use could be breaking things.

          Thanks for reporting, suggesting and testing, Jason and Joseph!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - re-resolving this as fixed, I haven't found more place where the old (incorrect) lower() use could be breaking things. Thanks for reporting, suggesting and testing, Jason and Joseph! Ciao
          Hide
          Glenys Hanson added a comment -

          I just tried make a new, two-item scale on Lang Teaching and got this error message: Field "grade" does not exist in table "cvsadmin"

          Show
          Glenys Hanson added a comment - I just tried make a new, two-item scale on Lang Teaching and got this error message: Field "grade" does not exist in table "cvsadmin"
          Hide
          Joseph Rézeau added a comment -

          @Glenys,
          Not sure this is related with the bug being reported here. Which version of Moodle are you using?
          What do you mean by "try to make a new, two-item scale on Lang Teaching" ?
          More detailed info welcome...
          ATB
          Joseph

          Show
          Joseph Rézeau added a comment - @Glenys, Not sure this is related with the bug being reported here. Which version of Moodle are you using? What do you mean by "try to make a new, two-item scale on Lang Teaching" ? More detailed info welcome... ATB Joseph
          Hide
          Helen Foster added a comment -

          Joseph, the Lang Teaching course that Glenys refers to is on moodle.org.

          Glenys, please could you create a new issue for the scale problem, selecting Moodle Community Sites as project and moodle.org as the component. (cvsadmin is specific to moodle.org and is actually due to be removed - see MDLSITE-1189.)

          Show
          Helen Foster added a comment - Joseph, the Lang Teaching course that Glenys refers to is on moodle.org. Glenys, please could you create a new issue for the scale problem, selecting Moodle Community Sites as project and moodle.org as the component. (cvsadmin is specific to moodle.org and is actually due to be removed - see MDLSITE-1189 .)

            People

            • Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: