Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed the log_check_backup function to execute a count_records

instead of selecting everyting (crash when there is a lot of log entries).
  • Loading branch information...
commit 4f39d4fb3a18d37519d9aca2b5abf4fdbc00128b 1 parent 025288e
stronk7 authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 backup/backuplib.php
View
10 backup/backuplib.php
@@ -104,17 +104,13 @@ function log_check_backup($course) {
global $CFG;
- //Execute the insert
- $status = execute_sql($sql_insert,false);
+ //Now execute the count
+ $ids = count_records("log","course",$course);
- //Now execute the select
- $ids = get_records_sql("SELECT DISTINCT l.id,l.course
- FROM {$CFG->prefix}log l
- WHERE l.course = '$course'");
//Gets the user data
$info[0][0] = get_string("logs");
if ($ids) {
- $info[0][1] = count($ids);
+ $info[0][1] = $ids;
} else {
$info[0][1] = 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.