Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-13847 backup/restore issues meta
  3. MDL-17370

Forum: PHP Warning when not ratings for max aggregate

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3, 2.0
    • Fix Version/s: 1.9.5
    • Component/s: Forum
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      While looking at MDL-17369, I came across the following PHP warning:

      Warning: max() [function.max]: Array must contain at least one element in /home/arborrow/Moodle/code/cvshead/mod/forum/lib.php on line 3584

      Attached is a patch file based on HEAD but could easily be applied to 1.9. Essentially I am just moving things around to avoid calling max if there are no ratings yet. Let me know if there are any questions.

      Peace - Anthony

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              aborrow Anthony Borrow
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/09