mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-75177' of https://github.com/paulholden/moodle
This commit is contained in:
commit
139a629763
@ -100,11 +100,19 @@ class course_category extends base {
|
||||
$this->get_entity_name()
|
||||
))
|
||||
->add_joins($this->get_joins())
|
||||
->add_join($this->get_context_join())
|
||||
->set_type(column::TYPE_TEXT)
|
||||
->add_fields("{$tablealias}.name, {$tablealias}.id")
|
||||
->add_fields(context_helper::get_preload_record_columns_sql($tablealiascontext))
|
||||
->add_callback(static function(?string $name, stdClass $category): string {
|
||||
return empty($category->id) ? '' :
|
||||
core_course_category::get($category->id, MUST_EXIST, true)->get_formatted_name();
|
||||
if (empty($category->id)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
context_helper::preload_from_record($category);
|
||||
$context = context_coursecat::instance($category->id);
|
||||
|
||||
return format_string($category->name, true, ['context' => $context]);
|
||||
})
|
||||
->set_is_sortable(true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user