Problem/Motivation
Currently FormBuilder::retrieveForm()
examines the result returned by a form builder function. If it is a response, it will send it to the browser and exit. As per #2230121: Remove exit() from FormBuilder this behavior is incompatible with the HTTP kernel because it gives any form whether it is rendered in the main content area or in a block the power to completely break the normal request/response flow.
Proposed resolution
Trigger a E_USER_DEPRECATED
when form builder methods return response objects and fix affected forms in core - instead having them throw a EnforcedResponseException.
Add a EnforcedResponseException::redirectToUrl factory method to simplify this process
Remaining tasks
Get tests green
Reviews
Change notice
Release notes snippet