Skip to content

Commit

Permalink
Limit choices for autocomplete text fields to visible courses
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed May 19, 2024
1 parent 74d7c2e commit 0dba972
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion field/field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ public function get_datalynx_instances_menu(): array {
INNER JOIN {course_modules} cm ON d.id = cm.instance
INNER JOIN {modules} m ON m.id = cm.module
LEFT JOIN {datalynx_fields} df ON d.id = df.dataid
LEFT JOIN {course} c ON c.id = d.course
WHERE m.name = 'datalynx'
AND cm.deletioninprogress = 0
AND df.type = 'text'";
AND df.type = 'text'
AND c.visible = 1";

$datalynxs = [];
if ($dlids = $DB->get_fieldset_sql($sql)) {
Expand Down

0 comments on commit 0dba972

Please sign in to comment.