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

Evaluating a model filtering by course does not work anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Analytics
    • Labels:
    • Testing Instructions:
      Hide
      1. Run php admin/tool/analytics/cli/evaluate_model.php --modelid=1 --reuse-prev-analysed=0 --timesplitting='\core\analytics\time_splitting\quarters_accum' --filter=$ID1,$ID2 (where $ID1 and $ID2 are the ids of courses in your site)
      2. You should not see any PHP Notice nor any debug backtrace
      Show
      Run php admin/tool/analytics/cli/evaluate_model.php --modelid=1 --reuse-prev-analysed=0 --timesplitting='\core\analytics\time_splitting\quarters_accum' --filter=$ID1,$ID2 (where $ID1 and $ID2 are the ids of courses in your site) You should not see any PHP Notice nor any debug backtrace
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60631_master

      Description

      This is a regression recently introduced in MDL-60434. Models evaluation CLI script allow users to select a subset of the course analysable elements. This do not work anymore since MDL-60434 as analysables now receive just an int (the course int in the only case we have in core)

      Notice: Trying to get property of non-object in /home/davidm/Desktop/moodlecode/master/analytics/classes/local/analyser/by_course.php on line 57
       
      Notice: Trying to get property of non-object in /home/davidm/Desktop/moodlecode/master/analytics/classes/course.php on line 162
       
      Notice: Trying to get property of non-object in /home/davidm/Desktop/moodlecode/master/analytics/classes/course.php on line 181
       
      Notice: Trying to get property of non-object in /home/davidm/Desktop/moodlecode/master/analytics/classes/course.php on line 194
      !!! Can not find data record in database table course. !!!
      !! SELECT * FROM {course} WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord !!
      !! Stack trace: * line 1546 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      * line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      * line 588 of /lib/datalib.php: call to moodle_database->get_record()
      * line 194 of /analytics/classes/course.php: call to get_course()
      * line 389 of /analytics/classes/course.php: call to core_analytics\course->load()
      * line 253 of /analytics/classes/course.php: call to core_analytics\course->get_course_data()
      * line 403 of /analytics/classes/course.php: call to core_analytics\course->get_start()
      * line 129 of /lib/classes/analytics/target/course_dropout.php: call to core_analytics\course->was_started()
      * line 363 of /analytics/classes/local/analyser/base.php: call to core\analytics\target\course_dropout->is_valid_analysable()
      * line 195 of /analytics/classes/local/analyser/base.php: call to core_analytics\local\analyser\base->process_analysable()
      * line 258 of /analytics/classes/local/analyser/base.php: call to core_analytics\local\analyser\base->get_analysable_data()
      * line 521 of /analytics/classes/model.php: call to core_analytics\local\analyser\base->get_labelled_data()
      * line 92 of /admin/tool/analytics/cli/evaluate_model.php: call to core_analytics\model->evaluate()
       !!
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17