MDL-23204 convert text to html in url intro
authorPetr Skoda <skodak@moodle.org>
Fri, 16 Jul 2010 09:32:51 +0000 (09:32 +0000)
committerPetr Skoda <skodak@moodle.org>
Fri, 16 Jul 2010 09:32:51 +0000 (09:32 +0000)
mod/url/db/upgradelib.php

index 2a1a0ae..5b50c08 100644 (file)
@@ -71,11 +71,19 @@ function url_20_migrate() {
 
         upgrade_set_timeout();
 
 
         upgrade_set_timeout();
 
+        if ($CFG->texteditors !== 'textarea') {
+            $intro       = text_to_html($candidate->intro, false, false, true);
+            $introformat = FORMAT_HTML;
+        } else {
+            $intro       = $candidate->intro;
+            $introformat = FORMAT_MOODLE;
+        }
+
         $url = new object();
         $url->course       = $candidate->course;
         $url->name         = $candidate->name;
         $url = new object();
         $url->course       = $candidate->course;
         $url->name         = $candidate->name;
-        $url->intro        = $candidate->intro;
-        $url->introformat  = $candidate->introformat;
+        $url->intro        = $intro;
+        $url->introformat  = $introformat;
         $url->externalurl  = $path;
         $url->timemodified = time();
 
         $url->externalurl  = $path;
         $url->timemodified = time();