mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-76362-master-extra' of https://github.com/andrewnicols/moodle
This commit is contained in:
commit
da144479fb
81 changed files with 961 additions and 432 deletions
|
@ -64,7 +64,7 @@ class course_summary_exporter extends \core\external\exporter {
|
|||
if ($progress === 0 || $progress > 0) {
|
||||
$hasprogress = true;
|
||||
}
|
||||
$progress = floor($progress);
|
||||
$progress = floor($progress ?? 0);
|
||||
$coursecategory = \core_course_category::get($this->data->category, MUST_EXIST, true);
|
||||
return array(
|
||||
'fullnamedisplay' => get_course_display_name_for_list($this->data),
|
||||
|
|
|
@ -618,7 +618,7 @@ abstract class base {
|
|||
$course = $this->get_course();
|
||||
try {
|
||||
$sectionpreferences = (array) json_decode(
|
||||
get_user_preferences('coursesectionspreferences_' . $course->id, null, $USER->id)
|
||||
get_user_preferences("coursesectionspreferences_{$course->id}", '', $USER->id)
|
||||
);
|
||||
if (empty($sectionpreferences)) {
|
||||
$sectionpreferences = [];
|
||||
|
|
|
@ -84,7 +84,7 @@ class frontpagesection implements named_templatable, renderable {
|
|||
$sectionoutput = new $this->sectionclass($format, $section);
|
||||
$sectionoutput->hide_controls();
|
||||
|
||||
if (trim($section->name) == '') {
|
||||
if (trim($section->name ?? '') == '') {
|
||||
$sectionoutput->hide_title();
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ switch ($mode) {
|
|||
$coursenode->collapse = true;
|
||||
$coursenode->make_inactive();
|
||||
|
||||
if (!preg_match('/^user\d{0,}$/', $activenode->key)) { // No user name found.
|
||||
if (!preg_match('/^user\d{0,}$/', $activenode->key ?? '')) { // No user name found.
|
||||
$userurl = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $course->id));
|
||||
// Add the user name.
|
||||
$usernode = $activenode->add(fullname($user), $userurl, navigation_node::TYPE_SETTING);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue