From a95682b2b3a2e42649d50a316847ef60c83b3974 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Wed, 13 Apr 2011 15:03:25 +0200 Subject: [PATCH] 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. --- admin/index.php | 12 ++++++++++++ lang/en/admin.php | 8 +++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/admin/index.php b/admin/index.php index c0e7ec4b9db..47ce50c19ab 100644 --- a/admin/index.php +++ b/admin/index.php @@ -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) { diff --git a/lang/en/admin.php b/lang/en/admin.php index 081cc01ebea..427fa20f55b 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -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';