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

Avoid fetching ratings in activities not using them

    XMLWordPrintable

    Details

    • Database:
      PostgreSQL
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Reported by Penny, it seems that we are trying to get ratings for forums/glossaries/data activities configured as "no ratings".

      This causes the function get_aggregation_method() to be called with incorrect aggregation method that leads to "null" value returned and PostgreSQL (and potentially others) breaking badly.

      So, the correct behavior should be to avoid completely any fetch of ratings if the activity is set to "no ratings".

      In the mean time, I've added one debugging message to the get_aggregation_method() function to make it easy to detect wrong uses (and default to AVG to have always one correct answer there).

      So, right now it's working, but all those wrong calls must be avoided (in the module or in the get_ratings() function).

      Ciao

        Attachments

          Activity

            People

            Assignee:
            andyjdavis Andrew Davis
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10