mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-18293 removed obsoleted checking of return values from insert and update_record + unused strings cleanup
This commit is contained in:
parent
a8c31db2a3
commit
0bcf8b6f0d
10 changed files with 21 additions and 83 deletions
|
@ -1497,9 +1497,7 @@ class assignment_base {
|
|||
// $submission->timemodified = time();
|
||||
}
|
||||
|
||||
if (! $DB->update_record('assignment_submissions', $submission)) {
|
||||
return false;
|
||||
}
|
||||
$DB->update_record('assignment_submissions', $submission);
|
||||
|
||||
// triger grade event
|
||||
$this->update_grade($submission);
|
||||
|
|
|
@ -85,9 +85,7 @@ class assignment_offline extends assignment_base {
|
|||
$submission->timemodified = time();
|
||||
}
|
||||
|
||||
if (! $DB->update_record('assignment_submissions', $submission)) {
|
||||
return false;
|
||||
}
|
||||
$DB->update_record('assignment_submissions', $submission);
|
||||
|
||||
// triger grade event
|
||||
$this->update_grade($submission);
|
||||
|
|
|
@ -873,9 +873,7 @@ function data_update_instance($data) {
|
|||
$data->notification = 0;
|
||||
}
|
||||
|
||||
if (! $DB->update_record('data', $data)) {
|
||||
return false;
|
||||
}
|
||||
$DB->update_record('data', $data);
|
||||
|
||||
data_grade_item_update($data);
|
||||
|
||||
|
|
|
@ -81,9 +81,7 @@
|
|||
$newrating->userid = $USER->id;
|
||||
$newrating->recordid = $record->id;
|
||||
$newrating->rating = $rating;
|
||||
if (! $DB->insert_record('data_ratings', $newrating)) {
|
||||
print_error('cannotinsertrate', 'error', '', (object)array('id'=>$record->id, 'rating'=>$rating));
|
||||
}
|
||||
$DB->insert_record('data_ratings', $newrating);
|
||||
data_update_grades($data, $record->userid);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,9 +90,7 @@
|
|||
$newrating->post = $post->id;
|
||||
$newrating->rating = $rating;
|
||||
|
||||
if (! $DB->insert_record('forum_ratings', $newrating)) {
|
||||
print_error('cannotinsertrate', 'error', '', (object)array('id'=>$postid, 'rating'=>$rating));
|
||||
}
|
||||
$DB->insert_record('forum_ratings', $newrating);
|
||||
forum_update_grades($forum, $post->userid);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,9 +88,7 @@
|
|||
} else if ($rating != $oldrating->rating) {
|
||||
$oldrating->rating = $rating;
|
||||
$oldrating->time = time();
|
||||
if (! $DB->update_record("glossary_ratings", $oldrating)) {
|
||||
print_error('cannotinsertrate', 'error', '', (object)array('id'=>$entry->id, 'rating'=>$rating));
|
||||
}
|
||||
$DB->update_record("glossary_ratings", $oldrating);
|
||||
glossary_update_grades($glossary, $entry->userid);
|
||||
}
|
||||
|
||||
|
@ -101,9 +99,7 @@
|
|||
$newrating->entryid = $entry->id;
|
||||
$newrating->rating = $rating;
|
||||
|
||||
if (! $DB->insert_record("glossary_ratings", $newrating)) {
|
||||
print_error('cannotinsertrate', 'error', '', (object)array('id'=>$entry->id, 'rating'=>$rating));
|
||||
}
|
||||
$DB->insert_record("glossary_ratings", $newrating);
|
||||
glossary_update_grades($glossary, $entry->userid);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue