mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
Merge branch 'MDL-79027' of https://github.com/paulholden/moodle
This commit is contained in:
commit
9c444cefc6
1 changed files with 8 additions and 1 deletions
|
@ -363,7 +363,14 @@ class main implements renderable, templatable {
|
||||||
if (!$this->displaygroupingcustomfield) {
|
if (!$this->displaygroupingcustomfield) {
|
||||||
return [];
|
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) {
|
if (!$fieldid) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue