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

Undefined variable: outcomeexists when adding a forum with an outcome, but no rating

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.3
    • Fix Version/s: None
    • Component/s: Course, Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_28_STABLE

      Description

      To reproduce:

      Create a course with outcomes.
      Add a new forum and associate it with an outcome, but do not set ratings for the forum (this will result in no grade item being created).
      When saving a warning will result:

      Notice: Undefined variable: outcomeexists in /PATH/modlib.php on line 296

      It's basically caused by having outcomeexists defined in the if($items) because an unrated forum will have no grade item. I suspect it would be safe to just move the declaration of outcomeexists outside the if statement.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              daniel.barnett Daniel Barnett
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: