Commit 0087a79b authored by Tristan Olive's avatar Tristan Olive

Data import process

Fixed team import counter

(DBOINC-91)
parent 5909852f
......@@ -851,10 +851,22 @@ function boincimport_teams_op($boincteam, &$context) {
// Save the team node
node_save($node);
$success = ($node->nid) ? TRUE : FALSE;
// Save the team IDs to a BOINC <--> Drupal reference table.
db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam->id, $node->nid);
$message = '';
if ($success) {
// Store some result for post-processing in the finished callback.
$context['results']['success'][] = $boincteam->id;
$message = "Successfully imported team {$boincteam->id}";
}
else {
$context['results']['failure'][] = $boincteam->id;
$message = "Failed to import team {$boincteam->id}!";
}
// Update our progress information.
$context['sandbox']['progress']++;
$context['sandbox']['current_team'] = $boincteam->id;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment