MDL-27053 Code maturity info added to admin notifications page
The patch introduces a new string to be displayed at admin notifications page. The maturity level message for upgrade/install reworded as requested in the tracker. The patch also adds a new core call to purge all caches at the beginning of the upgrade. This must be done before the upgrade starts so that the strings are re-fetched from the updated source and not from the on-disk cache.
This commit is contained in:
@@ -194,6 +194,7 @@ if (empty($CFG->version)) {
|
||||
}
|
||||
|
||||
if ($version > $CFG->version) { // upgrade
|
||||
purge_all_caches();
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
@@ -407,6 +408,17 @@ if (any_new_admin_settings($adminroot)){
|
||||
admin_externalpage_setup('adminnotifications');
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Unstable code warning
|
||||
if (isset($maturity)) {
|
||||
if ($maturity < MATURITY_STABLE) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
echo $OUTPUT->box(
|
||||
get_string('maturitycoreinfo', 'admin', $maturitylevel) . ' ' .
|
||||
$OUTPUT->doc_link('admin/versions', get_string('morehelp')),
|
||||
'generalbox adminwarning maturityinfo');
|
||||
}
|
||||
}
|
||||
|
||||
if ($insecuredataroot == INSECURE_DATAROOT_WARNING) {
|
||||
echo $OUTPUT->box(get_string('datarootsecuritywarning', 'admin', $CFG->dataroot), 'generalbox adminwarning');
|
||||
} else if ($insecuredataroot == INSECURE_DATAROOT_ERROR) {
|
||||
|
||||
+5
-3
@@ -684,9 +684,11 @@ $string['maturity50'] = 'Alpha';
|
||||
$string['maturity100'] = 'Beta';
|
||||
$string['maturity150'] = 'Release candidate';
|
||||
$string['maturity200'] = 'Stable version';
|
||||
$string['maturitycorewarning'] = 'You are going to install or upgrade Moodle to a version marked as "{$a}"
|
||||
that is not considered as production-ready yet. Please make sure this is intentional
|
||||
and that you are using correct checkout of Moodle source code.';
|
||||
$string['maturitycoreinfo'] = 'Your site is currently running unstable "{$a}" development code.';
|
||||
$string['maturitycorewarning'] = 'The version of Moodle that you are about to install or upgrade to contains
|
||||
unstable "{$a}" development code that is not suitable for use on most production
|
||||
sites. If this is not what you wanted then you should make sure you are updating
|
||||
from a STABLE branch of the Moodle code. See Moodle Docs for more details.';
|
||||
$string['maxbytes'] = 'Maximum uploaded file size';
|
||||
$string['maxconsecutiveidentchars'] = 'Consecutive identical characters';
|
||||
$string['maxeditingtime'] = 'Maximum time to edit posts';
|
||||
|
||||
Reference in New Issue
Block a user