- π¬π§United Kingdom joachim
> redirect response if the batch is progressive. No return value otherwise.
I'm not sure what a *progressive* batch is.
The docs should say that a RedirectResponse *may* be returned, to send the user to a page other than the default batch results page.
They should also say that if there are multiple batch sets, only the last redirect is used:
// If a batch 'finished' callback requested a redirect after the batch // is complete, save that for later use. If more than one batch set // returned a redirect, the last one is used.
It would be nice also if the sample code had a redirect added to it, e.g.:
return new RedirectResponse(Url::fromRoute('my.batch.results')->toString());
Tagging as novice, updating version, and setting to bug report as this is missing documentation.
- First commit to issue fork.
diederik.beirnaert β made their first commit to this issueβs fork.
- Merge request !8061[#2860627]: Update documentation for callback_batch_finished to include RedirectResponse β (Open) created by diederik.beirnaert
Updated documentation for callback_batch_finished to include RedirectResponse.
And added an example:// Optionally, redirect if needed. if (shouldRedirect()) { // Assume shouldRedirect() is a function that determines if a redirect is necessary. return new \Drupal\Core\Routing\RedirectResponse(\Drupal\Core\Url::fromRoute('example.route')->toString()); }
- Status changed to Needs work
7 months ago 10:05am 14 May 2024 - π¬π§United Kingdom joachim
Nearly there -- looks good overall, just a few formatting fixes needed.
- Status changed to Needs review
6 months ago 9:12am 18 June 2024 - Status changed to Needs work
6 months ago 9:47am 18 June 2024 The Needs Review Queue Bot β tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- Status changed to Needs review
6 months ago 7:18am 19 June 2024 - Status changed to Needs work
6 months ago 7:47am 19 June 2024 The Needs Review Queue Bot β tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.