user MDL-19825 Converted get_record to use DB object

This commit is contained in:
Sam Hemelryk 2009-12-07 06:13:09 +00:00
parent 5633445f59
commit 81e3e1555e

View file

@ -37,7 +37,7 @@ class category_form extends moodleform {
/// Check the name is unique /// Check the name is unique
if (!empty($data->id)) { // we are editing an existing record if (!empty($data->id)) { // we are editing an existing record
$olddata = get_record('user_info_category', 'id', $data->id); $olddata = $DB->get_record('user_info_category', array('id'=>$data->id));
// name has changed, new name in use, new name in use by another record // name has changed, new name in use, new name in use by another record
$dupfound = (($olddata->name !== $data->name) && $duplicate && ($data->id != $duplicate->id)); $dupfound = (($olddata->name !== $data->name) && $duplicate && ($data->id != $duplicate->id));
} }