mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-55136 data_object: fix param handling in fetch_all_helper
This commit is contained in:
parent
ac8d6cff54
commit
a106fb8178
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user