Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-41342_25' of git://github.com/dmonllao/moodle into …

…MOODLE_25_STABLE

Conflicts:
	theme/bootstrapbase/style/moodle.css
  • Loading branch information...
commit 8ecd67c48e73b691b77c8866586beb17e303a863 2 parents 1cf52db + c455e8b
@stronk7 stronk7 authored
View
9 admin/index.php
@@ -223,6 +223,13 @@
}
if ($version > $CFG->version) { // upgrade
+
+ // Warning about upgrading a test site.
+ $testsite = false;
+ if (defined('BEHAT_SITE_RUNNING')) {
+ $testsite = 'behat';
+ }
+
// We purge all of MUC's caches here.
// Caches are disabled for upgrade by CACHE_DISABLE_ALL so we must set the first arg to true.
// This ensures a real config object is loaded and the stores will be purged.
@@ -255,7 +262,7 @@
$PAGE->set_cacheable(false);
$output = $PAGE->get_renderer('core', 'admin');
- echo $output->upgrade_confirm_page($a->newversion, $maturity);
+ echo $output->upgrade_confirm_page($a->newversion, $maturity, $testsite);
die();
} else if (empty($confirmrelease)){
View
22 admin/renderer.php
@@ -135,9 +135,10 @@ public function unsatisfied_dependencies_page($version, array $failed, moodle_ur
* during upgrade.
* @param string $strnewversion
* @param int $maturity
+ * @param string $testsite
* @return string HTML to output.
*/
- public function upgrade_confirm_page($strnewversion, $maturity) {
+ public function upgrade_confirm_page($strnewversion, $maturity, $testsite) {
$output = '';
$continueurl = new moodle_url('index.php', array('confirmupgrade' => 1));
@@ -145,6 +146,7 @@ public function upgrade_confirm_page($strnewversion, $maturity) {
$output .= $this->header();
$output .= $this->maturity_warning($maturity);
+ $output .= $this->test_site_warning($testsite);
$output .= $this->confirm(get_string('upgradesure', 'admin', $strnewversion), $continueurl, $cancelurl);
$output .= $this->footer();
@@ -604,6 +606,24 @@ protected function maturity_warning($maturity) {
'generalbox maturitywarning');
}
+ /*
+ * If necessary, displays a warning about upgrading a test site.
+ *
+ * @param string $testsite
+ * @return string HTML
+ */
+ protected function test_site_warning($testsite) {
+
+ if (!$testsite) {
+ return '';
+ }
+
+ return $this->box(
+ $this->container(get_string('testsiteupgradewarning', 'admin', $testsite)),
+ 'generalbox testsitewarning'
+ );
+ }
+
/**
* Output the copyright notice.
* @return string HTML to output.
View
1  lang/en/admin.php
@@ -1012,6 +1012,7 @@
$string['tablesnosave'] = 'Changes in tables above are saved automatically.';
$string['tabselectedtofront'] = 'On tables with tabs, should the row with the currently selected tab be placed at the front';
$string['tabselectedtofronttext'] = 'Bring selected tab row to front';
+$string['testsiteupgradewarning'] = 'You are currently using the {$a} test site, to upgrade it properly use the command line interface tool';
$string['themedesignermode'] = 'Theme designer mode';
$string['themelist'] = 'Theme list';
$string['themenoselected'] = 'No theme selected';
View
2  theme/bootstrapbase/less/moodle/admin.less
@@ -208,6 +208,7 @@ img.iconsmall {
#page-admin-index .releasenoteslink,
#page-admin-index .adminwarning,
#page-admin-index .maturitywarning,
+#page-admin-index .testsitewarning,
#page-admin-index .maturityinfo {
.alert;
width: 60%;
@@ -215,6 +216,7 @@ img.iconsmall {
margin: auto;
}
#page-admin-index .maturitywarning,
+#page-admin-index .testsitewarning,
#page-admin-index .adminwarning.maturityinfo.maturity50 {
.alert-error;
}
View
2  theme/bootstrapbase/style/moodle.css
1 addition, 1 deletion not shown
View
5 theme/standard/style/admin.css
@@ -19,7 +19,8 @@
#page-admin-index .adminerror,
#page-admin-index .adminwarning {margin:20px;}
-#page-admin-index .maturitywarning {margin-left:auto;margin-right:auto;text-align:center;width:60%;background-color:#ffd3d9;}
+#page-admin-index .maturitywarning,
+#page-admin-index .testsitewarning {margin-left:auto;margin-right:auto;text-align:center;width:60%;background-color:#ffd3d9;}
#page-admin-index .releasenoteslink {margin-left:auto;margin-right:auto;text-align:center;width:60%;}
#page-admin-enrol .enrolplugintable {width:700px;margin:1em auto;}
@@ -149,4 +150,4 @@ table.flexible .r1 {background-color: #FAFAFA;}
#page-admin-modules.dir-rtl .generaltable th.c0,
#page-admin-modules.dir-rtl .generaltable td.c0,
#page-admin-auth.dir-rtl .generaltable th.c0,
-#page-admin-auth.dir-rtl .generaltable td.c0 {text-align: right;}
+#page-admin-auth.dir-rtl .generaltable td.c0 {text-align: right;}
Please sign in to comment.
Something went wrong with that request. Please try again.