Commit 87a577aa authored by Mihail Geshoski's avatar Mihail Geshoski
Browse files

MDL-72094 core_report: Deprecate report_helper::save_selected_report()

parent 1dc3fa2c
......@@ -71,6 +71,7 @@ class report_helper {
/**
* Save the last selected report in the session
*
* @deprecated since Moodle 4.0
* @param int $id The course id
* @param moodle_url $url The moodle url
* @return void
......@@ -78,6 +79,9 @@ class report_helper {
public static function save_selected_report(int $id, moodle_url $url):void {
global $USER;
debugging('save_selected_report() has been deprecated because it is no longer used and will be '.
'removed in future versions of Moodle', DEBUG_DEVELOPER);
// Last selected report.
if (!isset($USER->course_last_report)) {
$USER->course_last_report = [];
......
......@@ -62,12 +62,16 @@ class report_helper_test extends \advanced_testcase {
$url1 = new moodle_url($courseurlid[0]['url']);
$courseid1 = $courseurlid[0]['id'];
report_helper::save_selected_report($courseid1, $url1);
$this->assertDebuggingCalled('save_selected_report() has been deprecated because it is no ' .
'longer used and will be removed in future versions of Moodle');
$this->assertEquals($USER->course_last_report[$courseid1], $url1);
$url2 = new moodle_url($courseurlid[1]['url']);
$courseid2 = $courseurlid[1]['id'];
report_helper::save_selected_report($courseid2, $url2);
$this->assertDebuggingCalled('save_selected_report() has been deprecated because it is no ' .
'longer used and will be removed in future versions of Moodle');
$this->assertEquals($USER->course_last_report[$courseid2], $url2);
}
......
This files describes API changes in /report/* - plugins,
information provided here is intended especially for developers.
=== 4.0 ===
* The method report_helper::save_selected_report() has been been deprecated because it is no longer used.
=== 3.11 ===
* The new report plugin's can have drop down, which can be included by calling static
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment