mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-74678' of https://github.com/lostrogit/moodle
This commit is contained in:
commit
47097ae519
@ -132,10 +132,14 @@ class cohort extends base {
|
||||
->add_joins($this->get_joins())
|
||||
->set_type(column::TYPE_TEXT)
|
||||
->add_fields("{$tablealias}.description, {$tablealias}.descriptionformat, {$tablealias}.id, {$tablealias}.contextid")
|
||||
->add_callback(static function(string $description, stdClass $cohort): string {
|
||||
->add_callback(static function(?string $description, stdClass $cohort): string {
|
||||
global $CFG;
|
||||
require_once("{$CFG->libdir}/filelib.php");
|
||||
|
||||
if ($description === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$description = file_rewrite_pluginfile_urls($description, 'pluginfile.php', $cohort->contextid, 'cohort',
|
||||
'description', $cohort->id);
|
||||
|
||||
|
@ -141,10 +141,14 @@ class course_category extends base {
|
||||
AND {$tablealiascontext}.contextlevel = " . CONTEXT_COURSECAT)
|
||||
->set_type(column::TYPE_TEXT)
|
||||
->add_fields("{$tablealias}.description, {$tablealias}.descriptionformat, {$tablealiascontext}.id AS contextid")
|
||||
->add_callback(static function(string $description, stdClass $category): string {
|
||||
->add_callback(static function(?string $description, stdClass $category): string {
|
||||
global $CFG;
|
||||
require_once("{$CFG->libdir}/filelib.php");
|
||||
|
||||
if ($description === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$description = file_rewrite_pluginfile_urls($description, 'pluginfile.php', $category->contextid, 'coursecat',
|
||||
'description', null);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user