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

Error Reading from Database when one uses Ratings with Discussion Forum

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: Forum, Ratings
    • Labels:
      None
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      Add a Forum: Standard Forum for General Use

      Ratings: Aggregate Type: Average of Ratings - or anything else

      Get Error reading from database

      Not Ratings - WORKS FINE

      Show
      Add a Forum: Standard Forum for General Use Ratings: Aggregate Type: Average of Ratings - or anything else Get Error reading from database Not Ratings - WORKS FINE
    • Workaround:
      Hide

      Don't Use Ratings for the Discussion Forum

      Show
      Don't Use Ratings for the Discussion Forum
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      Error Reading from Database when one uses Ratings with Discussion Forum

      Error reading from database

      More information about this error

      Debug info: ORA-00979: not a GROUP BY expression
      SELECT r.itemid, r.component, r.ratingarea, r.contextid,
      SUM(r.rating) AS aggrrating, COUNT(r.rating) AS numratings,
      ur.id, ur.userid, ur.scaleid, ur.rating AS usersrating
      FROM m_rating r
      LEFT JOIN m_rating ur ON ur.contextid = r.contextid AND
      ur.itemid = r.itemid AND
      ur.component = r.component AND
      ur.ratingarea = r.ratingarea AND
      ur.userid = :o_userid
      WHERE r.contextid = :o_contextid AND
      r.itemid = :o_param9 AND
      r.component = :o_component AND
      r.ratingarea = :o_ratingarea
      GROUP BY r.itemid, r.component, r.ratingarea, r.contextid, ur.id, ur.userid, ur.scaleid
      ORDER BY r.itemid
      [array (
      'o_userid' => '77',
      'o_contextid' => '162',
      'o_param9' => '34',
      'o_component' => 'mod_forum',
      'o_ratingarea' => 'post',
      )]
      Stack trace:
      line 393 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 268 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
      line 1070 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      line 585 of /rating/lib.php: call to oci_native_moodle_database->get_records_sql()
      line 5469 of /mod/forum/lib.php: call to rating_manager->get_ratings()
      line 271 of /mod/forum/discuss.php: call to forum_print_discussion()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andyjdavis Andrew Davis
                Reporter:
                cpduggan Cindy Duggan
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: