]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20767 can not use messaging in upgrade and fatal errors in strings
authorPetr Skoda <skodak@moodle.org>
Sat, 7 Nov 2009 09:31:20 +0000 (09:31 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 7 Nov 2009 09:31:20 +0000 (09:31 +0000)
lang/en_utf8/admin.php
lib/db/upgrade.php

index cc8af818b44a44fcd6b237c39741d51cae8751e7..fa092b8ed7c9a200379d209ef3838366a088a9bd 100644 (file)
@@ -39,28 +39,10 @@ $string['blockmultiple'] = 'Multiple';
 $string['blocksettings'] = 'Manage blocks';
 $string['bloglevel'] = 'Blog visibility';
 $string['bloglevelupgrade'] = 'Blog visibility upgrade';
-$string['bloglevelupgradebody'] = 'Hi! You are receiving this message as an administrator of $a->sitename.
-
-This site has recently been upgraded to Moodle 2.0.
-
-Blog visibility was simplified in 2.0, but your site still uses one of the old visibility types.
-
-To preserve the course-based or group-based visibility of the blog entries on your site, you need to run the following upgrade script, which will create a special "blog" type forum in each course whose enrolled users have posted blog entries, and will copy these blog entries in this special forum.
-
-Blogs will then be entirely switched off at the site level. No blog entries will be deleted in the process.
-
-You can run the script by visiting $a->fixurl.
-';
-$string['bloglevelupgradehtml'] = '<p>Hi! You are receiving this message as an administrator of $a->sitename.</p>
-
-<p>This site has recently been upgraded to Moodle 2.0.</p>
-
+$string['bloglevelupgradedescription'] = '<p>This site has recently been upgraded to Moodle 2.0.</p>
 <p>Blog visibility was simplified in 2.0, but your site still uses one of the old visibility types. </p>
-
-<p>To preserve the course-based or group-based visibility of the blog entries on your site, you need to run the following upgrade script, which will create a special "blog" type forum in each course whose enrolled users have posted blog entries, and will copy these blog entries in this special forum. </p>
-
+<p>To preserve the course-based or group-based visibility of the blog entries on your site, you need to run the following upgrade script, which will create a special \"blog\" type forum in each course whose enrolled users have posted blog entries, and will copy these blog entries in this special forum. </p>
 <p>Blogs will then be entirely switched off at the site level. No blog entries will be deleted in the process.</p>
-
 <p>You can run the script by visiting <a href=\"$a->fixurl\">the blog level upgrade page</a>.</p>';
 $string['bloglevelupgradeinfo'] = 'Blog visibility was simplified in 2.0, but your site still uses one of the old visibility types. To preserve the course-based or group-based visibility of the blog entries on your site, the following upgrade script will create a special "blog" type forum in each course whose enrolled users have posted blog entries, and will copy these blog entries in this special forum. Blogs will then be entirely switched off at the site level. No blog entries will be deleted in the process.';
 $string['bloglevelupgradenotice'] = 'Your site is using an old blog visibility setting, the <a href=\"bloglevelupgrade.php\">blog visibility upgrade</a> is recommended.';
index 14580b7776603a781b01c5ca3f2ef0fb1aff97da..781992782de747ca57778851ebb3b77574976ce3 100644 (file)
@@ -2686,21 +2686,11 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
             $a->sitename = $site->fullname;
             $a->fixurl   = "$CFG->wwwroot/$CFG->admin/bloglevelupgrade.php";
 
-            $subject   = get_string('bloglevelupgrade', 'admin');
-            $plainbody = get_string('bloglevelupgradebody', 'admin', $a);
-            $htmlbody  = get_string('bloglevelupgradehtml', 'admin', $a);
-
-            foreach ($admins as $admin) {
-                $eventdata = new object();
-                $eventdata->component = 'moodle';
-                $eventdata->userfrom = $USER;
-                $eventdata->userto = $admin;
-                $eventdata->subject = $subject;
-                $eventdata->fullmessage = $plainbody;
-                $eventdata->fullmessageformat = FORMAT_PLAIN;
-                $eventdata->fullmessagehtml = $htmlbody;
-                events_trigger('message_send', $eventdata);
-            }
+            $subject = get_string('bloglevelupgrade', 'admin');
+            $description = get_string('bloglevelupgradedescription', 'admin', $a);
+
+            // can not use messaging here because it is not configured yet!
+            upgrade_log(UPGRADE_LOG_NOTICE, null, $subject, $description);
         }
     /// Main savepoint reached
         upgrade_main_savepoint($result, 2009103000);