Permalink
Browse files

Merge branch 'MDL-32712-22' of https://github.com/mackensen/moodle in…

…to MOODLE_22_STABLE
  • Loading branch information...
2 parents 9787d3a + 7f64975 commit 18da8c03e03ef68dc5622dc65492e60a40dc6a93 @danpoltawski danpoltawski committed Oct 31, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 mod/assignment/db/upgrade.php
@@ -150,6 +150,18 @@ function xmldb_assignment_upgrade($oldversion) {
/// Launch rename field format
$dbman->rename_field($table, $field, 'introformat');
+ /// Conditionally migrate to html format in intro
+ if ($CFG->texteditors !== 'textarea') {
+ $rs = $DB->get_recordset('assignment', array('introformat' => FORMAT_MOODLE), '', 'id,intro,introformat');
+ foreach ($rs as $a) {
+ $a->intro = text_to_html($a->intro, false, false, true);
+ $a->introformat = FORMAT_HTML;
+ $DB->update_record('assignment', $a);
+ upgrade_set_timeout();
+ }
+ $rs->close();
+ }
+
/// assignment savepoint reached
upgrade_mod_savepoint(true, 2009042001, 'assignment');
}

0 comments on commit 18da8c0

Please sign in to comment.