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

News forum items with ratings report DB errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.1.2
    • 2.1.1, 2.2
    • Forum, Ratings
    • PostgreSQL
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_21_STABLE
    • MDL-27845_rating_aggregation
    • Hide

      1. set up a moodle site using postgresql as the database if you dont already have one
      2. access a forum and submit a rating
      3. check that the aggregate updates appropriately (assuming your use has the capabilities required to see the aggregate)

      Show
      1. set up a moodle site using postgresql as the database if you dont already have one 2. access a forum and submit a rating 3. check that the aggregate updates appropriately (assuming your use has the capabilities required to see the aggregate)

      I got this error when access news forum: Debug info:

      ERROR: column "ur.rating" must appear in the GROUP BY clause or be used in an aggregate function
      LINE 3: ... ur.id, ur.userid, ur.scaleid, ur.rating ...
      ^
      SELECT r.itemid, r.component, r.ratingarea, r.contextid,
      AVG(r.rating) AS aggrrating, COUNT(r.rating) AS numratings,
      ur.id, ur.userid, ur.scaleid, ur.rating AS usersrating
      FROM mdl_rating r
      LEFT JOIN mdl_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 = $1
      WHERE r.contextid = $2 AND
      r.itemid = $3 AND
      r.component = $4 AND
      r.ratingarea = $5
      GROUP BY r.itemid, r.component, r.ratingarea, r.contextid, ur.id, ur.userid, ur.scaleid
      ORDER BY r.itemid
      [array (
      0 => '2',
      1 => '28',
      2 => '31',
      3 => 'mod_forum',
      4 => 'post',
      )]

            andyjdavis Andrew Davis
            salvetore Michael de Raadt
            Aparup Banerjee Aparup Banerjee
            Petr Skoda Petr Skoda
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.