Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293211

Do not allow form builder functions to return Response objects

$
0
0

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

User interface changes

API changes


Viewing all articles
Browse latest Browse all 293211

Trending Articles