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

"ERROR: Incorrect number of query parameters" on forum posts page

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Forum
    • Labels:
    • Environment:
      Redhat Enterprise
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      When logged in as a student and clicking on the "Posts" or "Discussions" links under My Profile -> Forum posts in the Navigation block
      I get the following error...

      ERROR: Incorrect number of query parameters. Expected 20, got 19.

      The course I am in does have a Q&A forum enabled, so perhaps the code here does not handle hidden posts properly?

        Gliffy Diagrams

          Activity

          Hide
          vrrandall Vernellia Randall added a comment -

          My students do not have access to the forum posting. 2.01 was working fine. This occurred when I upgraded to 2.01+ this week - Feb 6.

          Show
          vrrandall Vernellia Randall added a comment - My students do not have access to the forum posting. 2.01 was working fine. This occurred when I upgraded to 2.01+ this week - Feb 6.
          Hide
          vrrandall Vernellia Randall added a comment -

          Can you change this from minor to major. This error is blocking access to forums.

          Show
          vrrandall Vernellia Randall added a comment - Can you change this from minor to major. This error is blocking access to forums.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Hi,

          I guess Vernellia's problem is MDL-26288, related to ratings, with fix available @ MDL-26272 (just to avoid mixing things).

          I've reproduced this in my test site. I can see student posts perfectly, but logged as student, if I try to see forum posts or forum discussions, I get:

          ERROR: Incorrect number of query parameters. Expected 9, got 7.

          More information about this error

          Stack trace:
          line 697 of /lib/dml/moodle_database.php: dml_exception thrown
          line 770 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
          line 1256 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
          line 1331 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
          line 1502 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
          line 2036 of /mod/forum/lib.php: call to moodle_database->count_records_sql()
          line 121 of /mod/forum/user.php: call to forum_search_posts()

          Raising this to blocker and sending to STABLE backlog.

          Thanks for the report, ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Hi, I guess Vernellia's problem is MDL-26288 , related to ratings, with fix available @ MDL-26272 (just to avoid mixing things). I've reproduced this in my test site. I can see student posts perfectly, but logged as student, if I try to see forum posts or forum discussions, I get: ERROR: Incorrect number of query parameters. Expected 9, got 7. More information about this error Stack trace: line 697 of /lib/dml/moodle_database.php: dml_exception thrown line 770 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params() line 1256 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql() line 1331 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql() line 1502 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql() line 2036 of /mod/forum/lib.php: call to moodle_database->count_records_sql() line 121 of /mod/forum/user.php: call to forum_search_posts() Raising this to blocker and sending to STABLE backlog. Thanks for the report, ciao
          Hide
          skodak Petr Skoda added a comment -

          Fix should be available in the next weekly build, thanks for the report.

          petr

          Show
          skodak Petr Skoda added a comment - Fix should be available in the next weekly build, thanks for the report. petr

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                21/Feb/11