course-import MDL-24176 Fixed regression caused by custom backup extension+mimetype

This commit is contained in:
Sam Hemelryk
2010-09-16 03:51:30 +00:00
parent 5d38bd8c02
commit 74535bb575
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ if ($backup->get_stage() == backup_ui::STAGE_FINAL) {
if (!file_exists($tempdestination) || !is_dir($tempdestination)) {
$results = $backup->get_controller()->get_results();
$file = $results['backup_destination'];
$file->extract_to_pathname(get_file_packer($file->get_mimetype()), $tempdestination);
$file->extract_to_pathname(get_file_packer('application/zip'), $tempdestination);
}
// Delete the backup file, we only want the directory
$results['backup_destination']->delete();
+3 -3
View File
@@ -275,12 +275,12 @@ abstract class base_moodleform extends moodleform {
/**
* Removes an element from the form if it exists
* @param string $elementName
* @param string $elementname
* @return bool
*/
public function remove_element($elementName) {
public function remove_element($elementname) {
if ($this->_form->elementExists($elementname)) {
return $this->_form->removeElement($elementName);
return $this->_form->removeElement($elementname);
} else {
return false;
}