portfolio MDL-20905 fixing errors that affected box.net plugin
This commit is contained in:
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user