Skip to content

Commit e4637d5

Browse files
authored
Fixed error on blog index page when using custom blog route
Front controller reached 100 router match iterations
1 parent ea4be2f commit e4637d5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Controller/Router.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function __construct(
118118
\Magento\Framework\App\ResponseInterface $response,
119119
UrlResolverInterface $urlResolver = null
120120
) {
121-
121+
122122
$this->actionFactory = $actionFactory;
123123
$this->_eventManager = $eventManager;
124124
$this->_url = $url;
@@ -292,15 +292,21 @@ public function match(\Magento\Framework\App\RequestInterface $request)
292292
}
293293

294294
switch($blogPage['type']) {
295-
case 'rss':
295+
case Url::CONTROLLER_INDEX:
296+
$blogPage['type'] = 'index';
297+
$actionName = 'index';
298+
$idKey = null;
299+
break;
300+
301+
case Url::CONTROLLER_RSS:
296302
$actionName = 'feed';
297303
$idKey = null;
298304
break;
299-
case 'search':
305+
case Url::CONTROLLER_SEARCH:
300306
$actionName = 'index';
301307
$idKey = 'q';
302308
break;
303-
case 'archive':
309+
case Url::CONTROLLER_ARCHIVE:
304310
$actionName = 'view';
305311
$idKey = 'date';
306312
break;

0 commit comments

Comments
 (0)