Skip to content

Commit a912d27

Browse files
committed
Fixing the active state for the links with the same frontname
1 parent 64daebd commit a912d27

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/internal/Magento/Framework/View/Element/Html/Link/Current.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private function getMca()
7171
];
7272

7373
$parts = [];
74-
$pathParts = explode('/', $this->getPath());
74+
$pathParts = explode('/', trim($this->_request->getPathInfo(), '/'));
7575
foreach ($routeParts as $key => $value) {
7676
if (isset($pathParts[$key]) && $pathParts[$key] === $value) {
7777
$parts[] = $value;

lib/internal/Magento/Framework/View/Test/Unit/Element/Html/Link/CurrentTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function testIsCurrent()
6464
$path = 'test/index';
6565
$url = 'http://example.com/test/index';
6666

67+
$this->_requestMock->expects($this->once())
68+
->method('getPathInfo')
69+
->will($this->returnValue('/test/index/'));
6770
$this->_requestMock->expects($this->once())
6871
->method('getModuleName')
6972
->will($this->returnValue('test'));

0 commit comments

Comments
 (0)