Commit 98cb244d authored by Petr Skoda's avatar Petr Skoda
Browse files

MDL-45144 delete duplicated legacy log entries in mod_book

The general agreement is we should trigger one event
per simple action.

This partially resolves MDL-39963.
parent 43a7ac72
......@@ -77,7 +77,6 @@ if ($confirm) { // the operation was confirmed.
$fs->delete_area_files($context->id, 'mod_book', 'chapter', $chapter->id);
$DB->delete_records('book_chapters', array('id'=>$chapter->id));
add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
$params = array(
'context' => $context,
'objectid' => $chapter->id
......
......@@ -75,7 +75,6 @@ if ($mform->is_cancelled()) {
$DB->update_record('book_chapters', $data);
$DB->set_field('book', 'revision', $book->revision+1, array('id'=>$book->id));
add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
$params = array(
'context' => $context,
'objectid' => $data->id
......@@ -110,7 +109,6 @@ if ($mform->is_cancelled()) {
$DB->update_record('book_chapters', $data);
$DB->set_field('book', 'revision', $book->revision+1, array('id'=>$book->id));
add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
$params = array(
'context' => $context,
'objectid' => $data->id
......
......@@ -185,10 +185,6 @@ if (!$nothing) {
}
}
// MDL-39963 Decide what to do with those logs.
add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id);
book_preload_chapters($book); // fix structure
$DB->set_field('book', 'revision', $book->revision+1, array('id'=>$book->id));
......
......@@ -79,10 +79,6 @@ if (!$chapter->subchapter) {
}
}
// MDL-39963 Decide what to do with those logs.
add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id);
add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id);
book_preload_chapters($book); // fix structure
$DB->set_field('book', 'revision', $book->revision+1, array('id'=>$book->id));
......
......@@ -154,7 +154,6 @@ function toolbook_importhtml_import_chapters($package, $type, $book, $context, $
}
}
add_to_log($book->course, 'course', 'update mod', '../mod/book/view.php?id='.$context->instanceid, 'book '.$book->id);
$fs->delete_area_files($context->id, 'mod_book', 'importhtmltemp', 0);
// update the revision flag - this takes a long time, better to refetch the current value
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment