Browse files

MDL-33917 mod_resource - fix upgrade of front page resources

This only affected resources linked  as a full url
  • Loading branch information...
1 parent 9a7c3d5 commit dea59b1e67d77f03482cc048adb7094675ce4923 @danpoltawski danpoltawski committed Jul 13, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/resource/db/upgradelib.php
View
4 mod/resource/db/upgradelib.php
@@ -76,8 +76,8 @@ function resource_20_migrate() {
$context = get_context_instance(CONTEXT_MODULE, $candidate->cmid);
$sitecontext = get_context_instance(CONTEXT_COURSE, $siteid);
- $file_record = array('contextid'=>$context->id, 'component'=>'mod_resourse', 'filearea'=>'content', 'itemid'=>0);
- if ($file = $fs->get_file_by_hash(sha1("/$sitecontext->id/course/legacy/content/0".$path))) {
+ $file_record = array('contextid'=>$context->id, 'component'=>'mod_resource', 'filearea'=>'content', 'itemid'=>0);
+ if ($file = $fs->get_file_by_hash(sha1("/$sitecontext->id/course/legacy/0".$path))) {
try {
$fs->create_file_from_storedfile($file_record, $file);
} catch (Exception $x) {

0 comments on commit dea59b1

Please sign in to comment.