Merge branch 'MDL-87427-main-update' of https://github.com/meirzamoodle/moodle

This commit is contained in:
Andrew Nicols
2026-01-20 15:25:15 +08:00
13 changed files with 25 additions and 285 deletions
@@ -0,0 +1,5 @@
issueNumber: MDL-87427
notes:
core:
- message: The `relateduserid` key inside the `other` array has been removed.
type: removed
@@ -0,0 +1,18 @@
issueNumber: MDL-87427
notes:
core:
- message: >-
- The following files have been removed:
- `public/lib/classes/event/content_viewed.php`
- `public/lib/classes/exception/webservice_parameter_exception.php`
- The `lightbox` attribute has been removed from `public/lib/yui/src/notification/js/dialogue.js`.
- The following functions have been removed from `public/lib/deprecatedlib.php`:
- `get_context_instance()`
- `can_use_rotated_text()`
- `get_system_context()`
- `print_arrow()`
type: removed
core_course:
- message: >-
- The `\core_courseformat\output\section_renderer\core_course_renderer::course_category_tree_category()` has removed in `public/course/renderer.php`.
type: removed
-14
View File
@@ -139,20 +139,6 @@ class core_course_renderer extends plugin_renderer_base {
return $this->frontpage_combo_list();
}
/**
* Renderers a category for use with course_category_tree
*
* @deprecated since 2.5
*
* @param stdClass $category
* @param int $depth
* @return string
*/
final protected function course_category_tree_category(stdClass $category, $depth=1) {
debugging('Function core_course_renderer::course_category_tree_category() is deprecated', DEBUG_DEVELOPER);
return '';
}
/**
* Render a modchooser.
*
-124
View File
@@ -1,124 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Abstract event for content viewing.
*
* This class has been deprecated, please extend base event or other relevent abstract class.
*
* @package core
* @copyright 2013 Ankit Agarwal
* @deprecated since Moodle 2.7
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\event;
defined('MOODLE_INTERNAL') || die();
debugging('core\event\content_viewed has been deprecated. Please extend base event or other relevant abstract class.',
DEBUG_DEVELOPER);
/**
* Class content_viewed.
*
* This class has been deprecated, please extend base event or other relevent abstract class.
*
* @property-read array $other {
* Extra information about the event.
*
* - string content: name of the content viewed.
* }
*
* @package core
* @since Moodle 2.6
* @copyright 2013 Ankit Agarwal
* @deprecated since Moodle 2.7
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class content_viewed extends base {
/** @var null|array $legacylogdata Legacy log data */
protected $legacylogdata = null;
/**
* Set basic properties of the event.
*/
protected function init() {
global $PAGE;
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->context = $PAGE->context;
}
/**
* Set basic page properties.
*/
public function set_page_detail() {
global $PAGE;
if (!isset($this->data['other'])) {
$this->data['other'] = array();
}
$this->data['other'] = array_merge(array('url' => $PAGE->url->out_as_local_url(false),
'heading' => $PAGE->heading,
'title' => $PAGE->title), $this->data['other']);
}
/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('eventcontentviewed', 'moodle');
}
/**
* Returns non-localised description of what happened.
*
* @return string
*/
public function get_description() {
return "The user with id '$this->userid' viewed content.";
}
/**
* Custom validation.
*
* @throws \coding_exception when validation does not pass.
* @return void
*/
protected function validate_data() {
parent::validate_data();
// Make sure this class is never used without a content identifier.
if (empty($this->other['content'])) {
throw new \coding_exception('The \'content\' value must be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
/**
* This event has been deprected.
*
* @return boolean
*/
public static function is_deprecated() {
return true;
}
}
@@ -32,8 +32,6 @@ defined('MOODLE_INTERNAL') || die();
* @property-read int $relateduserid user who completed the course
* @property-read array $other {
* Extra information about event.
*
* - int relateduserid: deprecated since 2.7, please use property relateduserid
* }
*
* @package core
@@ -54,7 +52,6 @@ class course_completed extends base {
'relateduserid' => $completion->userid,
'context' => \context_course::instance($completion->course),
'courseid' => $completion->course,
'other' => array('relateduserid' => $completion->userid), // Deprecated since 2.7, please use property relateduserid.
)
);
$event->add_record_snapshot('course_completions', $completion);
@@ -109,12 +106,6 @@ class course_completed extends base {
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
// Check that the 'relateduserid' value is set in other as well. This is because we introduced this in 2.6
// and some observers may be relying on this value to be present.
if (!isset($this->other['relateduserid'])) {
throw new \coding_exception('The \'relateduserid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
@@ -1,45 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core\exception;
/**
* Web service parameter exception class.
*
* @deprecated since Moodle 2.2 - use moodle exception instead
* This exception must be thrown to the web service client when a web service parameter is invalid
* The error string is gotten from webservice.php
* @package core
* @subpackage exception
* @copyright Jerome Mouneyrac
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class webservice_parameter_exception extends moodle_exception {
/**
* Constructor.
*
* @param string $errorcode The name of the string from webservice.php to print
* @param string $a The name of the parameter
* @param string $debuginfo Optional information to aid debugging
*/
public function __construct($errorcode = null, $a = '', $debuginfo = null) {
parent::__construct($errorcode, 'webservice', '', $a, $debuginfo);
}
}
// Alias this class to the old name.
// This file will be autoloaded by the legacyclasses autoload system.
// In future all uses of this class will be corrected and the legacy references will be removed.
class_alias(webservice_parameter_exception::class, \webservice_parameter_exception::class);
-1
View File
@@ -48,7 +48,6 @@ $legacyclasses = [
\require_login_exception::class => 'exception/require_login_exception.php',
\require_login_session_timeout_exception::class => 'exception/require_login_session_timeout_exception.php',
\required_capability_exception::class => 'exception/required_capability_exception.php',
\webservice_parameter_exception::class => 'exception/webservice_parameter_exception.php',
// Cache API.
\cache::class => [
-35
View File
@@ -186,41 +186,6 @@ function get_component_directory($component) {
return core_component::get_component_directory($component);
}
/**
* @deprecated since 2.2, use context_course::instance() or other relevant class instead
*/
#[\core\attribute\deprecated('\core\context::instance', since: '2.2', mdl: 'MDL-34472', final: true)]
function get_context_instance() {
\core\deprecation::emit_deprecation(__FUNCTION__);
}
/**
* @deprecated since 2.5 - do not use, the textrotate.js will work it out automatically
*/
#[\core\attribute\deprecated('Not replaced', since: '2.0', mdl: 'MDL-19756', final: true)]
function can_use_rotated_text() {
\core\deprecation::emit_deprecation(__FUNCTION__);
}
/**
* @deprecated since 2.2
*/
#[\core\attribute\deprecated('\core\context\system::instance', since: '2.2', mdl: 'MDL-34472', final: true)]
function get_system_context() {
\core\deprecation::emit_deprecation(__FUNCTION__);
}
/**
* Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
* provide this function with the language strings for sortasc and sortdesc.
*
* @deprecated use $OUTPUT->arrow() instead.
*/
#[\core\attribute\deprecated('OUTPUT->[l|r]arrow', since: '2.0', mdl: 'MDL-19756', final: true)]
function print_arrow() {
\core\deprecation::emit_deprecation(__FUNCTION__);
}
/**
* rc4encrypt
*
@@ -661,25 +661,6 @@ Y.extend(DIALOGUE, Y.Panel, {
},
/**
* Whether to display the dialogue modally and with a
* lightbox style.
*
* @attribute lightbox
* @type Boolean
* @default true
* @deprecated Since Moodle 2.7. Please use modal instead.
*/
lightbox: {
lazyAdd: false,
setter: function(value) {
Y.log("The lightbox attribute of M.core.dialogue has been deprecated since Moodle 2.7, " +
"please use the modal attribute instead",
'warn', 'moodle-core-notification-dialogue');
this.set('modal', value);
}
},
/**
* Whether to display a close button on the dialogue.
*
File diff suppressed because one or more lines are too long
@@ -660,22 +660,6 @@ Y.extend(DIALOGUE, Y.Panel, {
},
/**
* Whether to display the dialogue modally and with a
* lightbox style.
*
* @attribute lightbox
* @type Boolean
* @default true
* @deprecated Since Moodle 2.7. Please use modal instead.
*/
lightbox: {
lazyAdd: false,
setter: function(value) {
this.set('modal', value);
}
},
/**
* Whether to display a close button on the dialogue.
*
-19
View File
@@ -631,25 +631,6 @@ Y.extend(DIALOGUE, Y.Panel, {
},
/**
* Whether to display the dialogue modally and with a
* lightbox style.
*
* @attribute lightbox
* @type Boolean
* @default true
* @deprecated Since Moodle 2.7. Please use modal instead.
*/
lightbox: {
lazyAdd: false,
setter: function(value) {
Y.log("The lightbox attribute of M.core.dialogue has been deprecated since Moodle 2.7, " +
"please use the modal attribute instead",
'warn', 'moodle-core-notification-dialogue');
this.set('modal', value);
}
},
/**
* Whether to display a close button on the dialogue.
*
-1
View File
@@ -51,7 +51,6 @@ global $CFG;
* @uses FEATURE_IDNUMBER
* @uses FEATURE_GROUPS
* @uses FEATURE_GROUPINGS
* @uses FEATURE_GROUPMEMBERSONLY
* @uses FEATURE_MOD_INTRO
* @uses FEATURE_BACKUP_MOODLE2
* @uses FEATURE_COMPLETION_TRACKS_VIEWS