2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
if(isset($_REQUEST['id'])&&$data=db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d AND token = '%s'",$_REQUEST['id'],drupal_get_token($_REQUEST['id'])))){
$batch=unserialize($data);
}
else{
if(!isset($_REQUEST['id'])){
returnFALSE;
}
// Retrieve the current state of batch from db.
$batch=db_query("SELECT batch FROM {batch} WHERE bid = :bid AND token = :token",array(
':bid'=>$_REQUEST['id'],
':token'=>drupal_get_token($_REQUEST['id']))
)->fetchField();
$batch=unserialize($batch);
// Register database update for end of processing.
register_shutdown_function('_batch_shutdown');
...
...
@@ -314,7 +318,9 @@ function _batch_finished() {
// Cleanup the batch table and unset the global $batch variable.
if($batch['progressive']){
db_query("DELETE FROM {batch} WHERE bid = %d",$batch['id']);
db_delete('batch')
->condition('bid',$batch['id'])
->execute();
}
$_batch=$batch;
$batch=NULL;
...
...
@@ -358,6 +364,9 @@ function _batch_finished() {
*/
function_batch_shutdown(){
if($batch=batch_get()){
db_query("UPDATE {batch} SET batch = '%s' WHERE bid = %d",serialize($batch),$batch['id']);