Moodle

Forum: PHP Warning when not ratings for max aggregate

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor 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

Issue Links

Activity

Hide
Anthony Borrow added a comment -

I'm going to go ahead and assign this to Nicolas as he will be looking at MDL-17369 which is somewhat related.

Show
Anthony Borrow added a comment - I'm going to go ahead and assign this to Nicolas as he will be looking at MDL-17369 which is somewhat related.
Hide
Petr Škoda (skodak) added a comment -

fixed, please test
thanks for the report

Show
Petr Škoda (skodak) added a comment - fixed, please test thanks for the report
Hide
Anthony Borrow added a comment -

Petr - I didn't have time for more than the most superficial of tests but looking at a max aggregate rated forum no longer shows an error. Peace - Anthony

Show
Anthony Borrow added a comment - Petr - I didn't have time for more than the most superficial of tests but looking at a max aggregate rated forum no longer shows an error. Peace - Anthony
Hide
Sam Hemelryk added a comment -

Resolved

Show
Sam Hemelryk added a comment - Resolved

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: