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

Load missing data if required in completion_info::is_enabled()

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.4
    • Component/s: Course completion
    • Labels:

      Description

      If an instance of the completion_info class is created with only a placeholder course object (e.g. with only 'id' => 2), the is_enabled() function will throw a notice when trying to access the course's "enablecompletion" property. Here is a patch to lazy load that field if it is missing and is needed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sry_not4sale Aaron Barnes
              Reporter:
              sry_not4sale Aaron Barnes
              Integrator:
              Sam Hemelryk
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                1/Aug/11