Skip to content
Snippets Groups Projects
Commit b25c72cd authored by catch's avatar catch
Browse files

Issue #3496403 by benjifisher: Remove obsolete try/catch block for batch ID

parent e8206cbd
No related branches found
No related tags found
3 merge requests!11197Issue #3506427 by eduardo morales alberti: Remove responsive_image.ajax from hook,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!617Issue #3043725: Provide a Entity Handler for user cancelation
Pipeline #403645 passed with warnings
Pipeline: drupal

#403657

    Pipeline: drupal

    #403653

      Pipeline: drupal

      #403647

        ......@@ -7,7 +7,6 @@
        use Drupal\Component\Utility\UrlHelper;
        use Drupal\Core\Batch\BatchStorageInterface;
        use Drupal\Core\Database\IntegrityConstraintViolationException;
        use Drupal\Core\Render\Element;
        use Drupal\Core\Render\Element\RenderElementBase;
        use Drupal\Core\Template\Attribute;
        ......@@ -901,24 +900,7 @@ function batch_process($redirect = NULL, ?Url $url = NULL, $redirect_callback =
        // Assign an id to progressive batches. Non-progressive batches skip
        // database storage completely.
        try {
        $batch['id'] = $batch['progressive'] ? \Drupal::service(BatchStorageInterface::class)->getId() : 'non-progressive';
        }
        catch (IntegrityConstraintViolationException) {
        // @todo this is here to support the update path to deprecate
        // Connection::nextId(). Remove in Drupal 11.
        $connection = \Drupal::database();
        $max_bid = (int) $connection->query('SELECT MAX([bid]) FROM {batch}')->fetchField();
        $batch['id'] = $max_bid + 1;
        $connection->insert('batch')
        ->fields([
        'bid' => $batch['id'],
        'timestamp' => \Drupal::time()->getRequestTime(),
        'token' => '',
        'batch' => NULL,
        ])
        ->execute();
        }
        $batch['id'] = $batch['progressive'] ? \Drupal::service(BatchStorageInterface::class)->getId() : 'non-progressive';
        // Move operations to a job queue. Non-progressive batches will use a
        // memory-based queue.
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment