Merge branch 'MDL-55136_dataobject_31' of git://github.com/davosmith/moodle into MOODLE_31_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2016-07-12 15:48:22 +02:00
+3 -2
View File
@@ -213,6 +213,7 @@ abstract class data_object {
$wheresql = array();
$dbparams = array();
foreach ($params as $var=>$value) {
if (!in_array($var, $instance->required_fields) and !array_key_exists($var, $instance->optional_fields)) {
continue;
@@ -221,7 +222,7 @@ abstract class data_object {
$wheresql[] = " $var IS NULL ";
} else {
$wheresql[] = " $var = ? ";
$params[] = $value;
$dbparams[] = $value;
}
}
@@ -232,7 +233,7 @@ abstract class data_object {
}
global $DB;
if ($datas = $DB->get_records_select($table, $wheresql, $params)) {
if ($datas = $DB->get_records_select($table, $wheresql, $dbparams)) {
$result = array();
foreach($datas as $data) {