mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-30929 detect incorrect major version upgrades
This commit is contained in:
parent
60e99097e4
commit
9008ec1654
4 changed files with 66 additions and 0 deletions
|
@ -190,6 +190,15 @@ if ($version > $CFG->version) { // upgrade
|
|||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
if (upgrade_stale_php_files_present()) {
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->upgrade_stale_php_files_page();
|
||||
die();
|
||||
}
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$a->oldversion = "$CFG->release ($CFG->version)";
|
||||
$a->newversion = "$release ($version)";
|
||||
|
|
|
@ -57,6 +57,26 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display page explaining proper upgrade process,
|
||||
* there can not be any PHP file leftovers...
|
||||
*
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function upgrade_stale_php_files_page() {
|
||||
$output = '';
|
||||
$output .= $this->header();
|
||||
$output .= $this->heading(get_string('upgradestalefiles', 'admin'));
|
||||
$output .= $this->box_start('generalbox', 'notice');
|
||||
$output .= get_string('upgradestalefilesinfo', 'admin', get_docs_url('Upgrading'));
|
||||
$output .= html_writer::empty_tag('br');
|
||||
$output .= html_writer::tag('div', $this->single_button($this->page->url, get_string('reload'), 'get'), array('class' => 'buttons'));
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the 'environment check' page that is displayed during install.
|
||||
* @param int $maturity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue