Skip to content
Snippets Groups Projects

[#2860627]: Update documentation for callback_batch_finished to include RedirectResponse

Open [#2860627]: Update documentation for callback_batch_finished to include RedirectResponse
3 unresolved threads
3 unresolved threads

Closes #2860627

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
111 113 * @param string $elapsed
112 114 * A string representing the elapsed time for the batch process, e.g.,
113 115 * '1 min 30 secs'.
116 * @return \Drupal\Core\Routing\RedirectResponse|null
  • 125 130 ];
    126 131 $message .= \Drupal::service('renderer')->render($list);
    127 132 \Drupal::messenger()->addStatus($message);
    128 }
    129 else {
    133
    134 // Optionally, redirect if needed.
    135 if (shouldRedirect()) { // Assume shouldRedirect() is a function that determines if a redirect is necessary.
    136 return new \Drupal\Core\Routing\RedirectResponse(\Drupal\Core\Url::fromRoute('example.route')->toString());
    137 }
    138 } else {
  • 136 145 ]);
    137 146 \Drupal::messenger()->addError($message);
    138 147 }
    148
    149 // Return NULL explicitly if no redirection is performed.
    150 return NULL;
    139 151 }
    140 152
    153
  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading