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

course_section_cm_completion()'s $completioninfo cannot be null anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7
    • Fix Version/s: None
    • Component/s: Course
    • Labels:

      Description

      Steps to reproduce
      ===============

      Call course_section_cm_completion() with null as the second parameter (the $completioninfo param).

       

      Actual result
      ==========

      Exception - Call to a member function is_tracked_user() on null

       

      Expected result
      ============

      A new completion_info object used to be created if $completioninfo was null. This code is actually still present not far below the call to is_tracked_user() in /course/renderer.php (line 415): 

      if ($completioninfo === null) {
            $completioninfo = new completion_info($course);
       
      }
      

      The call to is_tracked_user() should come after that.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nyanginator Nicholas Yang
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 minutes
                5m