mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-72094 core_report: Deprecate report_helper::save_selected_report()
This commit is contained in:
parent
1dc3fa2c55
commit
87a577aade
@ -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);
|
||||
}
|
||||
|
@ -1,6 +1,10 @@
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user