Skip to content

Commit

Permalink
MDL-17140 should check if $data->id isn't empty before sending to get…
Browse files Browse the repository at this point in the history
…_record
  • Loading branch information
danmarsden committed Nov 6, 2008
1 parent 591ffe1 commit f787e10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion user/profile/definelib.php
Expand Up @@ -143,7 +143,10 @@ function define_save($data) {

$data = $this->define_save_preprocess($data); /// hook for child classes

$old = $DB->get_record('user_info_field', array('id'=>(int)$data->id));
$old = false;
if (!empty($data->id)) {
$old = $DB->get_record('user_info_field', array('id'=>(int)$data->id));
}

/// check to see if the category has changed
if (!$old or $old->categoryid != $data->categoryid) {
Expand Down

0 comments on commit f787e10

Please sign in to comment.