MDL-39846 use new special value -1 in $CFG->loglifetime to prevent legacy logging
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user