diff --git a/src/lib/Zikula/Bundle/CoreBundle/EventListener/ExceptionListener.php b/src/lib/Zikula/Bundle/CoreBundle/EventListener/ExceptionListener.php index 96ef77e615..b5f1b41801 100644 --- a/src/lib/Zikula/Bundle/CoreBundle/EventListener/ExceptionListener.php +++ b/src/lib/Zikula/Bundle/CoreBundle/EventListener/ExceptionListener.php @@ -126,19 +126,24 @@ private function handleRouteNotFoundException(GetResponseForExceptionEvent $even $event->getRequest()->getSession()->getFlashBag()->add('error', $message); if ($userLoggedIn && \SecurityUtil::checkPermission('ZikulaRoutesModule::', '::', ACCESS_ADMIN)) { $originalRouteCollection = $this->router->getOriginalRouteCollection()->all(); - if (!array_key_exists('zikularoutesmodule_route_reload', $originalRouteCollection)) { - // reload routes for the Routes module first - $this->routesControllerUtil->reloadRoutesByModule('ZikulaRoutesModule'); - $this->cacheClearer->clear("symfony.routing"); + if (array_key_exists('zikularoutesmodule_route_reload', $originalRouteCollection)) { + $url = $this->router->generate('zikularoutesmodule_route_reload', array('lct' => 'admin'), RouterInterface::ABSOLUTE_URL); + $link = "". __('re-loading the routes') . ""; + $event->getRequest()->getSession()->getFlashBag()->add('error', __f('You might try %s for the extension in question.', $link)); } - $url = $this->router->generate('zikularoutesmodule_route_reload', array('lct' => 'admin'), RouterInterface::ABSOLUTE_URL); - $frontController = \System::getVar('entrypoint', 'index.php'); - if (strpos($url, "$frontController/") !== false) { - $url = str_ireplace("$frontController/", "", $url); - } - $event->getRequest()->getSession()->getFlashBag()->add('error', __('You might try re-loading the routes for the extension in question.')); - $event->setResponse(new RedirectResponse($url)); - $event->stopPropagation(); +// if (!array_key_exists('zikularoutesmodule_route_reload', $originalRouteCollection)) { +// // reload routes for the Routes module first +// $this->routesControllerUtil->reloadRoutesByModule('ZikulaRoutesModule'); +// $this->cacheClearer->clear("symfony.routing"); +// } +// $url = $this->router->generate('zikularoutesmodule_route_reload', array('lct' => 'admin'), RouterInterface::ABSOLUTE_URL); +// $frontController = \System::getVar('entrypoint', 'index.php'); +// if (strpos($url, "$frontController/") !== false) { +// $url = str_ireplace("$frontController/", "", $url); +// } +// $event->getRequest()->getSession()->getFlashBag()->add('error', __('You might try re-loading the routes for the extension in question.')); +// $event->setResponse(new RedirectResponse($url)); +// $event->stopPropagation(); } }