Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44021

Error when searching for more than word in Glossary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.11, 2.4.8, 2.5.4, 2.6, 2.7
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: Glossary
    • Labels:
    • Testing Instructions:
      Hide

      1. Create a glossary or find an existing one - it could even be empty
      2. Type "moodle rocks" in the search box and press search

      Error should be displayed. Once fix is deployed, appropriate results should be displayed.

      3. You may wish to try a combination of searches for 0,1,2+ terms with some/all words matching in the glossary terms, descriptions and/or aliases to be thorough but it doesn't really make any difference!

      Show
      1. Create a glossary or find an existing one - it could even be empty 2. Type "moodle rocks" in the search box and press search Error should be displayed. Once fix is deployed, appropriate results should be displayed. 3. You may wish to try a combination of searches for 0,1,2+ terms with some/all words matching in the glossary terms, descriptions and/or aliases to be thorough but it doesn't really make any difference!
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL44021

      Description

      See this discussion: https://moodle.org/mod/forum/discuss.php?d=253609

      1.- In a Glossary Search box, enter 2 words. You get this error:

      ERROR: duplicate parameter name in query
      Debug info:
      Error code: duplicateparaminsql
      Stack trace:
      line 868 of \lib\dml\moodle_database.php: dml_exception thrown
      line 991 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
      line 1415 of \lib\dml\moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 1488 of \lib\dml\moodle_database.php: call to moodle_database->get_record_sql()
      line 1659 of \lib\dml\moodle_database.php: call to moodle_database->get_field_sql()
      line 270 of \mod\glossary\sql.php: call to moodle_database->count_records_sql()
      line 378 of \mod\glossary\view.php: call to require()

      2.- In a Glossary Search box, enter 3 words. You get this error:
      ERROR: Incorrect number of query parameters. Expected 9, got 8.

      This used to work in Moodle 1.9. It seems that the Search function has been entirely re-written in Moodle 2, but it was never properly tested!

      This is really bad and ought to be fixed in all Moodle 2 versions ASAP.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jenny-gray Jenny Gray
              Reporter:
              rezeau Joseph Rézeau
              Peer reviewer:
              Sam Marshall
              Integrator:
              Marina Glancy
              Tester:
              Andrew Nicols
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14