}
$rssid = $DB->insert_record('block_rss_client', $dataobject);
- if (!$rssid) {
- print_error('updatersserror', 'error', '', $url);
- }
// By capturing the output from fetch_rss this way
// error messages do not display and clutter up the moodle interface
$string['undefinedprocessactionmethod'] = 'No action method defined in Data_Preset to handle action \"$a\".';
$string['unsupportedexport'] = '($a->fieldtype) cannot be exported.';
$string['updatefield'] = 'Update an existing field';
-$string['updatingerror'] = 'There was an error updating the database';
$string['uploadfile'] = 'Upload file';
$string['uploadrecords'] = 'Upload entries from a file';
$string['url'] = 'Url';
$string['usernotupdatederror'] = 'User not updated - error';
$string['usernotupdatednotexists'] = 'User not updated - does not exist';
$string['userselectortoomany'] = 'user_selector got more than one selected user, even though multiselect is false.';
-$string['updatersserror'] = 'There was an error trying to update RSS feed with id: $a';
$string['upgraderunning'] = 'Site is being upgraded, please retry later.';
$string['younotteacher'] = 'You are not a teacher!';
$string['wrongcall'] = 'This script is called wrongly';
$string['cannotaddsubscriber'] = 'Could not add subscriber with id $a to this forum!';
$string['cannotcreateinstanceforteacher'] = 'Could not create new course module instance for the teacher forum';
$string['cannotcreatediscussion'] = 'Could not create new discussion';
-$string['cannotconvertteachertogeneral'] = 'Could not change forum from type teacher to type general';
$string['cannotdeleteforummodule'] = 'You can not delete the forum module.';
$string['cannotdeletepost'] = 'You can\'t delete this post!';
$string['cannoteditposts'] = 'You can\'t edit other people\'s posts!';
$string['author'] = 'author';
$string['authorview'] = 'Browse by Author';
$string['back'] = 'Back';
-$string['cantexportentry'] = 'Could not export the entry to the main glossary';
$string['cantinsertcat'] = 'Can\'t insert category';
$string['cantinsertrec'] = 'Can\'t insert record';
$string['cantinsertrel'] = 'Can\'t insert relation category-entry';
$assignment->id = $assignment->instance;
$assignment->courseid = $assignment->course;
- if (!$DB->update_record('assignment', $assignment)) {
- return false;
- }
+ $DB->update_record('assignment', $assignment);
if ($assignment->timedue) {
$event = new object();
if (!isset($submission->submissioncomment)) {
$submission->submissioncomment = '';
}
- if (!$sid = $DB->insert_record('assignment_submissions', $submission)) {
- return false;
- }
+ $sid = $DB->insert_record('assignment_submissions', $submission);
$submission->id = $sid;
} else {
- if (!$DB->update_record('assignment_submissions', $submission)) {
- return false;
- }
+ $DB->update_record('assignment_submissions', $submission);
}
// triger grade event
$update->data2 = $data->format;
$update->timemodified = time();
- if (!$DB->update_record('assignment_submissions', $update)) {
- return false;
- }
+ $DB->update_record('assignment_submissions', $update);
$submission = $this->get_submission($USER->id);
$this->update_grade($submission);
$rec->id = $data->id;
$rec->defaultsort = 0;
$rec->defaultsortdir = 0;
- if (!$DB->update_record('data', $rec)) {
- print_error('updatingerror', 'data');
- }
+ $DB->update_record('data', $rec);
}
add_to_log($course->id, 'data', 'fields delete',
$rec->defaultsort = $defaultsort;
$rec->defaultsortdir = $defaultsortdir;
- if ($DB->update_record('data', $rec)) {
- redirect($CFG->wwwroot.'/mod/data/field.php?d='.$data->id, get_string('changessaved'), 2);
- } else {
- print_error('updatingerror', 'data');
- }
+ $DB->update_record('data', $rec);
+ redirect($CFG->wwwroot.'/mod/data/field.php?d='.$data->id, get_string('changessaved'), 2);
exit;
}
break;
// Get the old field data so that we can check whether the thumbnail dimensions have changed
$oldfield = $DB->get_record('data_fields', array('id'=>$this->field->id));
- if (!$DB->update_record('data_fields', $this->field)) {
- notify('updating of new field failed!');
- return false;
- }
+ $DB->update_record('data_fields', $this->field);
// Have the thumbnail dimensions changed?
if ($oldfield && ($oldfield->param4 != $this->field->param4 || $oldfield->param5 != $this->field->param5)) {
function update_field() {
global $DB;
- if (!$DB->update_record('data_fields', $this->field)) {
- notify('updating of new field failed!');
- return false;
- }
+ $DB->update_record('data_fields', $this->field);
return true;
}
$newdata = new object();
$newdata->id = $data->id;
$newdata->{$template} = $str;
- if (!$DB->update_record('data', $newdata)) {
- notify('Error updating template');
- } else {
- $data->{$template} = $str;
- }
+ $DB->update_record('data', $newdata);
+ $data->{$template} = $str;
}
return $str;
}
//save the feedback into the db
- if (!$DB->update_record("feedback", $feedback)) {
- return false;
- }
+ $DB->update_record("feedback", $feedback);
//create or update the new events
feedback_set_events($feedback);
$post->modified = time();
- if (!$DB->update_record('forum_posts', $post)) {
- return false;
- }
+ $DB->update_record('forum_posts', $post);
$discussion->timemodified = $post->modified; // last modified tracking
$discussion->usermodified = $post->userid; // last modified tracking
$post->message = file_save_draft_area_files($post->itemid, $context->id, 'forum_post', $post->id, array('subdirs'=>true), $post->message);
$DB->set_field('forum_posts', 'message', $post->message, array('id'=>$post->id));
- if (!$DB->update_record('forum_discussions', $discussion)) {
- return false;
- }
+ $DB->update_record('forum_discussions', $discussion);
forum_add_attachment($post, $forum, $cm, $mform, $message);
// Change the forum type to general.
$forum->type = 'general';
- if (!$DB->update_record('forum', $forum)) {
- print_error('cannotconvertteachertogeneral', 'forum');
- }
+ $DB->update_record('forum', $forum);
$context = get_context_instance(CONTEXT_MODULE, $cmid);
if (($forum->type == 'single') && ($updatepost->parent == '0')){ // updating first post of single discussion type -> updating forum intro
$forum->intro = $updatepost->message;
$forum->timemodified = time();
- if (!$DB->update_record("forum", $forum)) {
- print_error("couldnotupdate", "forum", $errordestination);
- }
+ $DB->update_record("forum", $forum);
}
$timemessage = 2;
$entry->glossaryid = $mainglossary->id;
$entry->sourceglossaryid = $glossary->id;
- if (!$DB->update_record('glossary_entries', $entry)) {
- print_error('cantexportentry', 'glossary');
- }
+ $DB->update_record('glossary_entries', $entry);
// move attachments too
$fs = get_file_storage();
$category = new object();
$category->name = $newcat->name;
$category->glossaryid = $glossary->id;
- if ( !$category->id = $DB->insert_record("glossary_categories",$category)) {
- // add to exception report (can't insert category)
- $rejections .= "<tr><td> <strong>" . get_string("category","glossary") . ":</strong>$newcat->name</td>" .
- "<td>" . get_string("cantinsertcat","glossary"). "</td></tr>";
- } else {
- $importedcats++;
- }
+ $category->id = $DB->insert_record("glossary_categories",$category);
+ $importedcats++;
}
if ( $category ) {
// inserting the new relation
$entrycat = new opbject();
$entrycat->entryid = $newentry->id;
$entrycat->categoryid = $category->id;
- if ( !$DB->insert_record("glossary_entries_categories",$entrycat) ) {
- // add to exception report (can't insert relation)
- $rejections .= "<tr><td> <strong>" . get_string("category","glossary") . ":</strong>$newcat->name</td>" .
- "<td>" . get_string("cantinsertrel","glossary"). "</td></tr>";
- }
+ $DB->insert_record("glossary_entries_categories",$entrycat);
}
}
}