Generated with the help of an LLM.

Problem/Motivation

batch_process() builds source_url with Url::fromRouteMatch(\Drupal::routeMatch()). A request from a dr console command has no matched route. The call throws InvalidArgumentException: Route required. Each console command that runs a batch must first set the <none> route on the request, as KernelTestBase does.

Steps to reproduce

Push an unrouted request on the request stack. Call batch_set(), set progressive to FALSE, then call batch_process().

Proposed resolution

batch_process() uses the <none> route for source_url when the route match has no route object. _batch_finished() reads source_url only for progressive batches. Non-progressive batches are not affected by the value.

Issue fork drupal-3638135

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

moshe weitzman created an issue.