From 9e7cc5103d30b5d7e948b086c7c3b31109f67917 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Wed, 5 Oct 2022 12:45:42 +0200 Subject: [PATCH] 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). --- mod/data/classes/manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/data/classes/manager.php b/mod/data/classes/manager.php index 5eb8907e1c3..8e9ebac175a 100644 --- a/mod/data/classes/manager.php +++ b/mod/data/classes/manager.php @@ -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; }