MDL-75276 mod_data: Re-add ordering to get_field_records

In MDL-75146, the get_fields_record() method was added without any
ordering criteria.
In MDL-75276, this method is reused to get the fields. We need to
re-add the order to guarantee the field are always returned in the
same order (and avoid some Oracle ordering failures).
This commit is contained in:
Sara Arjona 2022-10-05 12:45:42 +02:00
parent e2d606eba8
commit 9e7cc5103d

View File

@ -244,7 +244,7 @@ class manager {
public function get_field_records() {
global $DB;
if ($this->_fieldrecords === null) {
$this->_fieldrecords = $DB->get_records('data_fields', ['dataid' => $this->instance->id]);
$this->_fieldrecords = $DB->get_records('data_fields', ['dataid' => $this->instance->id], 'id');
}
return $this->_fieldrecords;
}