MDL-42804 data_mod: fix alternate name warning for deleting an entry

This commit is contained in:
rwijaya 2013-11-11 16:10:30 +08:00 committed by Damyon Wiese
parent b544b09636
commit 94738ee7d6

View File

@ -371,7 +371,12 @@
echo $OUTPUT->notification(get_string('recorddeleted','data'), 'notifysuccess');
}
} else { // Print a confirmation page
if ($deleterecord = $DB->get_record('data_records', array('id'=>$delete))) { // Need to check this is valid
$allnamefields = get_all_user_name_fields(true, 'u');
$dbparams = array($delete);
if ($deleterecord = $DB->get_record_sql("SELECT dr.*, $allnamefields
FROM {data_records} dr
JOIN {user} u on dr.userid = u.id
WHERE dr.id = ?", $dbparams, MUST_EXIST)) { // Need to check this is valid.
if ($deleterecord->dataid == $data->id) { // Must be from this database
$deletebutton = new single_button(new moodle_url('/mod/data/view.php?d='.$data->id.'&delete='.$delete.'&confirm=1'), get_string('delete'), 'post');
echo $OUTPUT->confirm(get_string('confirmdeleterecord','data'),