Commit 71e0447b authored by Crell's avatar Crell
Browse files

Only call our legacy init routines for a master request, to avoid it getting called twice.

parent d44e497b
......@@ -9,6 +9,7 @@
namespace Drupal\Core\EventSubscriber;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -27,16 +28,18 @@ class LegacyRequestSubscriber implements EventSubscriberInterface {
* The Event to process.
*/
public function onKernelRequestLegacy(GetResponseEvent $event) {
menu_set_custom_theme();
drupal_theme_initialize();
module_invoke_all('init');
// Tell Drupal it is now fully bootstrapped (for the benefit of code that
// calls drupal_get_bootstrap_phase()), but without having
// _drupal_bootstrap_full() do anything, since we've already done the
// equivalent above and in earlier listeners.
_drupal_bootstrap_full(TRUE);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {
menu_set_custom_theme();
drupal_theme_initialize();
module_invoke_all('init');
// Tell Drupal it is now fully bootstrapped (for the benefit of code that
// calls drupal_get_bootstrap_phase()), but without having
// _drupal_bootstrap_full() do anything, since we've already done the
// equivalent above and in earlier listeners.
_drupal_bootstrap_full(TRUE);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
}
/**
......
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