portfolio MDL-20905 fixing errors that affected box.net plugin

This commit is contained in:
Penny Leach
2009-11-19 07:03:53 +00:00
parent 40d6bc4825
commit b12fbe8e4c
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -1017,3 +1017,9 @@ function portfolio_export_pagesetup($PAGE, $caller) {
}
$PAGE->navbar->add(get_string('exporting', 'portfolio'));
}
function portfolio_export_type_to_id($type, $userid) {
global $DB;
$sql = 'SELECT t.id FROM {portfolio_tempdata} t JOIN {portfolio_instance} i ON t.instance = i.id WHERE t.userid = ? AND i.plugin = ?';
return $DB->get_field_sql($sql, array($userid, $type));
}
+1 -1
View File
@@ -59,7 +59,7 @@ if ($postcontrol && $type && !$dataid) {
throw new portfolio_exception('multiplesingleresume', 'portfolio');
}
if (!$dataid = $DB->get_field('portfolio_tempdata', 'id', array('type' => $type, 'userid' => $USER->id))) {
if (!$dataid = portfolio_export_type_to_id($type, $USER->id)) {
throw new portfolio_exception('invalidtempid', 'portfolio');
}
} else {