Skip to content

Commit

Permalink
MDL-37224 backup: fixed bug when searching for a course to import
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Feb 18, 2013
1 parent 1dd6835 commit db6539c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backup/import.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
$courseid = required_param('id', PARAM_INT); $courseid = required_param('id', PARAM_INT);
// The id of the course we are importing FROM (will only be set if past first stage // The id of the course we are importing FROM (will only be set if past first stage
$importcourseid = optional_param('importid', false, PARAM_INT); $importcourseid = optional_param('importid', false, PARAM_INT);
// We just want to check if a search has been run. True if anything is there.
$coursesearch = optional_param('search', false, PARAM_BOOL);
// The target method for the restore (adding or deleting) // The target method for the restore (adding or deleting)
$restoretarget = optional_param('target', backup::TARGET_CURRENT_ADDING, PARAM_INT); $restoretarget = optional_param('target', backup::TARGET_CURRENT_ADDING, PARAM_INT);


Expand All @@ -36,7 +38,7 @@
$renderer = $PAGE->get_renderer('core','backup'); $renderer = $PAGE->get_renderer('core','backup');


// Check if we already have a import course id // Check if we already have a import course id
if ($importcourseid === false) { if ($importcourseid === false || $coursesearch) {
// Obviously not... show the selector so one can be chosen // Obviously not... show the selector so one can be chosen
$url = new moodle_url('/backup/import.php', array('id'=>$courseid)); $url = new moodle_url('/backup/import.php', array('id'=>$courseid));
$search = new import_course_search(array('url'=>$url)); $search = new import_course_search(array('url'=>$url));
Expand Down

0 comments on commit db6539c

Please sign in to comment.