Skip to content

Commit

Permalink
MDL-12439, templates not imported in database preset import
Browse files Browse the repository at this point in the history
  • Loading branch information
toyomoyo committed Dec 6, 2007
1 parent ee7a11d commit 1ac5aab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1846,8 +1846,15 @@ function import() {
}
}
}

data_update_instance(addslashes_object($settings));

// existing valuas MUST be sent too - it can not work without them!
foreach ($this->data as $prop=>$unused) {
if (array_key_exists($prop, (array)$settings)) {
$this->data->$prop = $settings->$prop;
}
}

data_update_instance(addslashes_object($this->data));

if (strstr($this->folder, '/temp/')) clean_preset($this->folder); /* Removes the temporary files */
return true;
Expand Down
2 changes: 1 addition & 1 deletion mod/data/preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
echo '<input type="hidden" name="d" value="'.$data->id.'" />';
echo '<input type="hidden" name="action" value="importzip" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input name="file" size="20" value="" id="fromfile" type="text" /><input name="coursefiles" value="'.$strchooseorupload.'" onclick="return openpopup('."'/files/index.php?id=2&amp;choose=uploadpreset.file', 'coursefiles', 'menubar=0,location=0,scrollbars,resizable,width=750,height=500', 0".');" type="button" />';
echo '<input name="file" size="20" value="" id="fromfile" type="text" /><input name="coursefiles" value="'.$strchooseorupload.'" onclick="return openpopup('."'/files/index.php?id={$course->id}&amp;choose=uploadpreset.file', 'coursefiles', 'menubar=0,location=0,scrollbars,resizable,width=750,height=500', 0".');" type="button" />';
echo '<input type="submit" value="'.$strimport.'" />';
echo '</fieldset></form>';
echo '</td></tr>';
Expand Down

0 comments on commit 1ac5aab

Please sign in to comment.