Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b5f3c009
Commit
b5f3c009
authored
Oct 27, 2008
by
Dries
Browse files
- Patch
#319408
by Crell: converted queries to new database abstraction layer.
parent
df2cf40d
Changes
1
Show whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
b5f3c009
...
...
@@ -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'
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment