mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-79027 block_myoverview: retrieve only course related custom fields.
This commit is contained in:
parent
debed3eace
commit
1488a71d90
@ -363,7 +363,14 @@ class main implements renderable, templatable {
|
||||
if (!$this->displaygroupingcustomfield) {
|
||||
return [];
|
||||
}
|
||||
$fieldid = $DB->get_field('customfield_field', 'id', ['shortname' => $this->customfiltergrouping]);
|
||||
|
||||
// Get the relevant customfield ID within the core_course/course component/area.
|
||||
$fieldid = $DB->get_field_sql("
|
||||
SELECT f.id
|
||||
FROM {customfield_field} f
|
||||
JOIN {customfield_category} c ON c.id = f.categoryid
|
||||
WHERE f.shortname = :shortname AND c.component = 'core_course' AND c.area = 'course'
|
||||
", ['shortname' => $this->customfiltergrouping]);
|
||||
if (!$fieldid) {
|
||||
return [];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user