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

Undefined variable $course in calendar_event::properties()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4
    • 3.4.2
    • Calendar
    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • MDL-61152-master
    • Hide
      1. Login as an admin.
      2. Go to the calendar and press "New event" and create a "Category" "Type of event" in a category that contains courses
      3. Go to one of the courses of that category and follow the link to the calendar (on the left side menu)
      4. Search for the event you just created, hover the event link and take note of the id of that event (If you inspect the link using your browser's dev tools, the event ID is the value in the anchor tag's data-event-id attribute).
      5. Go to calendar/event.php?id=[THE_EVENT_ID]
      6. Save the event.
        • Confirm that you don't see any notice after saving the event.
      Show
      Login as an admin. Go to the calendar and press "New event" and create a "Category" "Type of event" in a category that contains courses Go to one of the courses of that category and follow the link to the calendar (on the left side menu) Search for the event you just created, hover the event link and take note of the id of that event (If you inspect the link using your browser's dev tools, the event ID is the value in the anchor tag's data-event-id attribute). Go to calendar/event.php?id= [THE_EVENT_ID] Save the event. Confirm that you don't see any notice after saving the event.

    Description

      The $course variable here is undefined in the case of category event types.

      To reproduce:

      1. Login as an admin.
      2. Create a category event.
      3. Take note of the id of that event (If you inspect the link using your browser's dev tools, the event ID is the value in the anchor tag's data-event-id attribute).
      4. Go to calendar/event.php?id=[THE_EVENT_ID]
      5. Save the event.
      6. Expected: The event will be successfully saved and no notice will be shown.
      7. Actual: The following output is being shown:

         
        Notice: Undefined variable: course in /home/jun/moodles/stable_master/moodle/calendar/lib.php on line 813
         
        Notice: Trying to get property of non-object in /home/jun/moodles/stable_master/moodle/calendar/lib.php on line 813
        Skip to main content
        

      Attachments

        Activity

          People

            jpataleta Jun Pataleta
            jpataleta Jun Pataleta
            Shamim Rezaie Shamim Rezaie
            David Monllaó David Monllaó
            Gladys Basiana Gladys Basiana
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              19/Mar/18