Skip to content

Commit

Permalink
MDL-16520 portfolio: when an exception happens, kill the active export
Browse files Browse the repository at this point in the history
  • Loading branch information
mjollnir_ committed Mar 1, 2009
1 parent e2ec531 commit ea95cf9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/portfolio/exceptions.php
Expand Up @@ -46,7 +46,7 @@ class portfolio_export_exception extends portfolio_exception {
* @param mixed $a language string data (optional, defaults to null)
*/
public function __construct($exporter, $errorcode, $module=null, $continue=null, $a=null) {
global $SCRIPT, $CFG;
global $CFG;

if (!empty($exporter) && $exporter instanceof portfolio_exporter) {
if (empty($continue)) {
Expand All @@ -55,9 +55,10 @@ public function __construct($exporter, $errorcode, $module=null, $continue=null,
$continue = $exporter->get('caller')->get_return_url();
}
}
if ($SCRIPT == "/$CFG->admin/cron.php") {
$exporter->process_stage_cleanup();
}
// this was previously only called if we were in cron,
// but I think if there's always an exception, we should clean up
// rather than force the user to resolve the export later.
$exporter->process_stage_cleanup();
} else {
global $SESSION;
if (!empty($SESSION->portfolioexport)) {
Expand Down

0 comments on commit ea95cf9

Please sign in to comment.