MDL-64739 analytics: No need for a fully set model on edit
authorDavid Monllaó <davidm@moodle.com>
Tue, 22 Oct 2019 02:48:29 +0000 (10:48 +0800)
committerDavid Monllaó <davidm@moodle.com>
Tue, 22 Oct 2019 02:48:29 +0000 (10:48 +0800)
admin/tool/analytics/model.php

index 3788f15..6b7511b 100644 (file)
@@ -122,7 +122,6 @@ switch ($action) {
 
         $invalidcurrenttimesplitting = $model->invalid_timesplitting_selected();
         $potentialtimesplittings = $model->get_potential_timesplittings();
-        $analyser = $model->get_analyser();
 
         $customdata = array(
             'id' => $model->get_id(),
@@ -134,7 +133,7 @@ switch ($action) {
             'indicators' => $model->get_potential_indicators(),
             'timesplittings' => $potentialtimesplittings,
             'predictionprocessors' => \core_analytics\manager::get_all_prediction_processors(),
-            'supportscontexts' => ($analyser)::context_restriction_support(),
+            'supportscontexts' => ($model->get_analyser(['notimesplitting' => true]))::context_restriction_support(),
             'contexts' => $model->get_contexts(),
         );
         $mform = new \tool_analytics\output\form\edit_model(null, $customdata);