Problem/Motivation
In the Form Approval Flow example, clicking Reject and send back to Employee on a non-modal approval task leaves the page unchanged. No error appears on the page, but Drupal records a PHP error.
The rejection may have been processed before the response fails, leaving the user unsure whether the action succeeded.
Steps to reproduce
1) Start a Form Approval Flow and submit a request.
2) Open Approve a Manager Request as a full page rather than a modal dialog by clicking on the Task Handler link in the /outstanding-tasks view
3) Click Reject and send back to Employee and Observe that the page does not redirect.
4) Check Drupal’s recent log messages and you will see:
TypeError: Drupal\Core\Render\MainContent\AjaxRenderer::renderResponse():
Argument #1 ($main_content) must be of type array, null given.
Proposed resolution
The example’s Reject button attaches an AJAX callback regardless of whether the task is opened in a modal. In non-modal mode, that callback does not return the response Drupal expects.
The proposed patch removes the modal AJAX handling for full-page submissions and allows completed tasks to follow their configured redirect. It also handles related modal cases: keeping validation errors visible and returning users safely to Task Console when a stale AJAX submission arrives after task completion.
Issue fork maestro-3629503
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
Comment #3
blainelang commentedTested on Drupal 10 and Drupal 11. Accept and Reject work correctly in both full-page and modal modes. No issues observed while testing the Form Approval Workflow example.