Commit 80d0419f authored by alexpott's avatar alexpott

Issue #2377967 by dawehner: Remove bc layer for _content _controller change

parent e789deca
......@@ -13,13 +13,10 @@
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Defines a subscriber to negotiate a _controller to use for a _content route.
* Sets the request format onto the request object.
*
* @todo Remove this event subscriber after both
* https://www.drupal.org/node/2092647 and https://www.drupal.org/node/2331919
* have landed.
*
* @see \Drupal\Core\EventSubscriber\MainContentViewSubscriber
* @todo Remove this event subscriber after
* https://www.drupal.org/node/2092647 has landed.
*/
class ContentControllerSubscriber implements EventSubscriberInterface {
......@@ -56,24 +53,6 @@ public function onRequestDeriveFormat(GetResponseEvent $event) {
}
}
/**
* Sets _content (if it exists) as the _controller.
*
* @todo Remove when https://www.drupal.org/node/2092647 lands.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* The event to process.
*/
public function onRequestDeriveController(GetResponseEvent $event) {
$request = $event->getRequest();
$controller = $request->attributes->get('_controller');
$content = $request->attributes->get('_content');
if (empty($controller) && !empty($content)) {
$request->attributes->set('_controller', $content);
}
}
/**
* Registers the methods in this class that should be listeners.
*
......@@ -82,7 +61,6 @@ public function onRequestDeriveController(GetResponseEvent $event) {
*/
static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = array('onRequestDeriveFormat', 31);
$events[KernelEvents::REQUEST][] = array('onRequestDeriveController', 30);
return $events;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment