mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 22:50:19 +01:00
MDL-76555 mod_resource: Fix PHP8.0 type error (legacy resources)
This commit is contained in:
parent
dd115e572a
commit
e2a7040d94
@ -269,12 +269,13 @@ function resource_get_coursemodule_info($coursemodule) {
|
||||
function resource_cm_info_view(cm_info $cm) {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/mod/resource/locallib.php');
|
||||
|
||||
$resource = (object) ['displayoptions' => $cm->customdata['displayoptions']];
|
||||
$details = resource_get_optional_details($resource, $cm);
|
||||
if ($details) {
|
||||
$cm->set_after_link(' ' . html_writer::tag('span', $details,
|
||||
array('class' => 'resourcelinkdetails')));
|
||||
$customdata = $cm->customdata;
|
||||
if (is_array($customdata) && isset($customdata['displayoptions'])) {
|
||||
$resource = (object) ['displayoptions' => $customdata['displayoptions']];
|
||||
$details = resource_get_optional_details($resource, $cm);
|
||||
if ($details) {
|
||||
$cm->set_after_link(' ' . html_writer::tag('span', $details, ['class' => 'resourcelinkdetails']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user