Sorting the Filter Picklist

Sorting the Filter Picklist

by Rob Cole -
Number of replies: 1

I am running Configurable Reports on Moodle 2.8. I add filters to a report. The filter picklist does not sort in display order. How can I sort the filter so it is easier to find and select an item from the list?


(See the attachment to see that the picklist is sorting in some random order. It should display it in alphabetical ascending order.)

Attachment config-report-filter-sort.png
Average of ratings: -
In reply to Rob Cole

Re: Sorting the Filter Picklist

by Rob Cole -

I was able to find the code that generates the picklist:
blocks\configurable_reports\components\filters\[name of filter]\plugin.class.php

The function print_filter returns the results from the database and populates the picklist. For example the course listing picklist can be put in alphabetical order by adding a sort parameter to the get_records_select call, such as $remotedb->get_records_select('course',"id $usql",$params, "fullname ASC");

I just have to remember to re-implement this picklist sort whenever the Configurable Reports module gets updated.