Skip to content

Commit

Permalink
MDL-52805 core: Remove legacy log plugin and more calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Mar 7, 2023
1 parent 5dace7a commit 33ebbdd
Show file tree
Hide file tree
Showing 36 changed files with 39 additions and 2,014 deletions.
16 changes: 0 additions & 16 deletions admin/renderer.php
Expand Up @@ -296,7 +296,6 @@ public function admin_notifications_page($maturity, $insecuredataroot, $errorsdi
$output .= $this->header();
$output .= $this->output->heading(get_string('notifications', 'admin'));
$output .= $this->maturity_info($maturity);
$output .= $this->legacy_log_store_writing_error();
$output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
$output .= $this->insecure_dataroot_warning($insecuredataroot);
$output .= $this->development_libs_directories_warning($devlibdir);
Expand Down Expand Up @@ -2192,21 +2191,6 @@ public function upgradekey_form_page($url) {
return $output;
}

/**
* Check to see if writing to the deprecated legacy log store is enabled.
*
* @return string An error message if writing to the legacy log store is enabled.
*/
protected function legacy_log_store_writing_error() {
$enabled = get_config('logstore_legacy', 'loglegacy');
$plugins = explode(',', get_config('tool_log', 'enabled_stores'));
$enabled = $enabled && in_array('logstore_legacy', $plugins);

if ($enabled) {
return $this->warning(get_string('legacylogginginuse'));
}
}

/**
* Display message about the benefits of registering on Moodle.org
*
Expand Down
25 changes: 0 additions & 25 deletions admin/tool/log/classes/log/manager.php
Expand Up @@ -199,29 +199,4 @@ public function dispose() {
$this->readers = null;
$this->writers = null;
}

/**
* Legacy add_to_log() redirection.
*
* To be used only from deprecated add_to_log() function and event trigger() method.
*
* NOTE: this is hardcoded to legacy log store plugin, hopefully we can get rid of it soon.
*
* @param int $courseid The course id
* @param string $module The module name e.g. forum, journal, resource, course, user etc
* @param string $action 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify
* @param string $url The file and parameters used to see the results of the action
* @param string $info Additional description information
* @param int $cm The course_module->id if there is one
* @param int|\stdClass $user If log regards $user other than $USER
* @param string $ip Override the IP, should only be used for restore.
* @param int $time Override the log time, should only be used for restore.
*/
public function legacy_add_to_log($courseid, $module, $action, $url = '', $info = '',
$cm = 0, $user = 0, $ip = null, $time = null) {
$this->init();
if (isset($this->stores['logstore_legacy'])) {
$this->stores['logstore_legacy']->legacy_add_to_log($courseid, $module, $action, $url, $info, $cm, $user, $ip, $time);
}
}
}
11 changes: 0 additions & 11 deletions admin/tool/log/db/install.php
Expand Up @@ -37,16 +37,5 @@ function xmldb_tool_log_install() {
$enabled[] = 'logstore_standard';
}

// Enable legacy log reading, but only if there are existing data.
if (file_exists("$CFG->dirroot/$CFG->admin/tool/log/store/legacy")) {
unset_config('loglegacy', 'logstore_legacy');
// Do not enabled legacy logging if somebody installed a new
// site and in less than one day upgraded to 2.7.
$params = array('yesterday' => time() - 60*60*24);
if ($DB->record_exists_select('log', "time < :yesterday", $params)) {
$enabled[] = 'logstore_legacy';
}
}

set_config('enabled_stores', implode(',', $enabled), 'tool_log');
}
53 changes: 0 additions & 53 deletions admin/tool/log/store/legacy/classes/event/legacy_logged.php

This file was deleted.

0 comments on commit 33ebbdd

Please sign in to comment.