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

Avoid PHP Notice in analytics

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.13, 3.10.10, 3.11.6, 4.0
    • None
    • Analytics
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE

    Description

      Hello,

      "PHP Notice" appear when running the cron for analytics.

      Example : "PHP Notice: Trying to get property 'timeend' of non-object in .../course/classes/analytics/target/course_enrolments.php on line 178".

      The problem is that the "retrieve" function (https://github.com/moodle/moodle/blob/master/analytics/classes/calculable.php#L142) can return "false", and the calling code does not do the necessary checks if it returns "false".
      Example: https://github.com/moodle/moodle/blob/master/course/classes/analytics/target/course_enrolments.php#L177

      It is therefore necessary to add the appropriate checks.

      Kind regards,

      Olivier

      Attachments

        Activity

          People

            Unassigned Unassigned
            Trolli Olivier Piton
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: