|
@@ -12,6 +12,7 @@ use Muzich\CoreBundle\ElementFactory\ElementManager;
|
12
|
12
|
use Muzich\CoreBundle\Entity\Element;
|
13
|
13
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
14
|
14
|
use Muzich\CoreBundle\Form\Search\ElementSearchForm;
|
|
15
|
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
15
|
16
|
|
16
|
17
|
class CoreController extends Controller
|
17
|
18
|
{
|
|
@@ -37,7 +38,12 @@ class CoreController extends Controller
|
37
|
38
|
$url_referer
|
38
|
39
|
);
|
39
|
40
|
|
40
|
|
- $params = $this->get('router')->match($url_referer);
|
|
41
|
+ try {
|
|
42
|
+ $params = $this->get('router')->match($url_referer.'552');
|
|
43
|
+ } catch (ResourceNotFoundException $exc) {
|
|
44
|
+ return $this->redirect($this->generateUrl('home', array('_locale' => $language)));
|
|
45
|
+ }
|
|
46
|
+
|
41
|
47
|
$params['_locale'] = $language;
|
42
|
48
|
$route = $params['_route'];
|
43
|
49
|
unset($params['_route'], $params['_controller']);
|