Follow-up to #2334233: Move Modal/Dialog detection to a View listener
Problem/Motivation
After we do #2334229: Move controller render array -> HtmlFragment conversion to a View listener; eliminate HtmlPageController, there will be little reason to keep Ajax detection pre-controller. Let's move it post-controller like html detection.
Proposed resolution
* Replace AjaxController with a view listener that checks for a render array AND a request format of drupal_ajax.
* Convert the controller result (a render array) into an AjaxResponse, using essentially the same code that is already in AjaxController. Set that as the response object.
* Remove the wrapping controller from ContentControllerSubscriber. Instead, for those request formats just change _content to _controller.
Remaining tasks
Do it.
User interface changes
None.
API changes
No external API changes. Note that I am marking this as for 8.1.x because I think it's likely we won't get to it until then, but it will be legal to do so as there will be no change to supported API behavior.
Implicitly this will make _controller work for returning render arrays for ajax, too, just like for html pages. That lets us deprecate _content.
Comments
Comment #1
Crell CreditAttribution: Crell commentedComment #2
Crell CreditAttribution: Crell commentedComment #3
Wim LeersFixed — although a bit differently — in #2352155: Remove HtmlFragment/HtmlPage.