$string['cannotremovefrommeta'] = 'Could not remove the selected course from this meta course!';
$string['cannotrestore'] = 'An error has occurred and the restore could not be completed!';
$string['cannotsavefile'] = 'Cannot save the file \"$a\".';
+$string['cannotinsertrecord'] = 'Could not insert new record ID $a';
$string['cannotsavemd5file'] = 'Cannot save md5 file.';
$string['cannotsavezipfile'] = 'Cannot save ZIP file.';
$string['cannotsetupcategory'] = 'Serious Error! Could not set up a default course category!';
$string['cannotupdatecategory'] = 'Could not update the category ($a)';
$string['cannotupdatecm'] = 'Could not update the course module with the correct section';
$string['cannotupdatelevel'] = 'Could not update the indent level on that course module';
+$string['cannotupdaterecord'] = 'Could not update record ID $a';
$string['cannotupdaterole'] = 'Cannot update role!';
$string['cannotupdatemod'] = 'Could not update the $a';
$string['cannotupdateuser'] = 'updating user failed';
$content = new object();
$content->recordid = $recordid;
$content->fieldid = $field->id;
- insert_record('data_content', $content);
+ if (! insert_record('data_content', $content)) {
+ print_error('cannotinsertrecord', '', '', $recordid);
+ }
}
// Fill data_content with the values imported from the CSV file:
foreach ($record as $key => $value) {
}
$oldcontent = get_record('data_content', 'fieldid', $field->id, 'recordid', $recordid);
$content->id = $oldcontent->id;
- update_record('data_content', $content);
+ if (! update_record('data_content', $content)) {
+ print_error('cannotupdaterecord', '', '', $recordid);
+ }
}
$recordsadded++;
print get_string('added', 'moodle', $recordsadded) . ". " . get_string('entry', 'data') . " (ID $recordid)<br />\n";