Permalink
Browse files

Merge branch 'MDL-29256-resource-format_22_STABLE' of git://github.co…

…m/mudrd8mz/moodle into MOODLE_22_STABLE
  • Loading branch information...
stronk7 committed Feb 27, 2012
2 parents 98e9b0f + 2d89ead commit edb03ff65b5afc63fce275bb9a30fd2297470ef7
Showing with 11 additions and 4 deletions.
  1. +11 −4 mod/page/backup/moodle1/lib.php
@@ -53,11 +53,18 @@ public function process_legacy_resource(array $data) {
$page['intro'] = $data['intro'];
$page['introformat'] = $data['introformat'];
$page['content'] = $data['alltext'];
- $page['contentformat'] = (int)$data['reference'];
- // this is unexpected but just in case (the same step applied during upgrade)
- if ($page['contentformat'] < 0 or $page['contentformat'] > 4) {
- $page['contentformat'] = FORMAT_MOODLE;
+ if ($data['type'] === 'html') {
+ // legacy Resource of the type Web page
+ $page['contentformat'] = FORMAT_HTML;
+
+ } else {
+ // legacy Resource of the type Plain text page
+ $page['contentformat'] = (int)$data['reference'];
+
+ if ($page['contentformat'] < 0 or $page['contentformat'] > 4) {
+ $page['contentformat'] = FORMAT_MOODLE;
+ }
}
$page['legacyfiles'] = RESOURCELIB_LEGACYFILES_ACTIVE;

0 comments on commit edb03ff

Please sign in to comment.