Commit b5f3c009 authored by Dries's avatar Dries
Browse files

- Patch #319408 by Crell: converted queries to new database abstraction layer.

parent df2cf40d
......@@ -2579,8 +2579,12 @@ function batch_process($redirect = NULL, $url = NULL) {
// Initiate db storage in order to get a batch id. We have to provide
// at least an empty string for the (not null) 'token' column.
db_query("INSERT INTO {batch} (token, timestamp) VALUES ('', %d)", REQUEST_TIME);
$batch['id'] = db_last_insert_id('batch', 'bid');
$batch['id'] = db_insert('batch')
->fields(array(
'token' => '',
'timestamp' => REQUEST_TIME,
))
->execute();
// Now that we have a batch id, we can generate the redirection link in
// the generic error message.
......@@ -2588,7 +2592,13 @@ function batch_process($redirect = NULL, $url = NULL) {
$batch['error_message'] = $t('Please continue to <a href="@error_url">the error page</a>', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished')))));
// Actually store the batch data and the token generated form the batch id.
db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']);
db_update('batch')
->condition('bid', $batch['id'])
->fields(array(
'token' => drupal_get_token($batch['id']),
'batch' => serialize($batch),
))
->execute();
drupal_goto($batch['url'], 'op=start&id=' . $batch['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