MDL-39846 use new special value -1 in $CFG->loglifetime to prevent legacy logging

This commit is contained in:
Petr Škoda
2013-07-19 08:43:31 +02:00
parent 132eff909c
commit ef1987dcdd
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -459,7 +459,7 @@ abstract class base implements \IteratorAggregate {
$this->triggered = true;
if (!empty($CFG->loglifetime)) {
if (isset($CFG->loglifetime) and $CFG->loglifetime != -1) {
if ($data = $this->get_legacy_logdata()) {
call_user_func_array('add_to_log', $data);
}
+11
View File
@@ -29,6 +29,17 @@ require_once(__DIR__.'/fixtures/event_fixtures.php');
class core_event_testcase extends advanced_testcase {
protected function setUp() {
global $CFG;
// No need to always modify log table here.
$CFG->loglifetime = '-1';
}
protected function tearDown() {
global $CFG;
$CFG->loglifetime = '0';
}
public function test_event_properties() {
global $USER;