Skip to content

Commit 7f3face

Browse files
author
vpaladiychuk
committed
MAGETWO-32989: Image isn't displayed in CMS page on Frontend if webserver rewrites = no
1 parent 7573b3a commit 7f3face

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/code/Magento/Widget/Model/Template/Filter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public function widgetDirective($construction)
119119
*/
120120
public function mediaDirective($construction)
121121
{
122-
$params = $this->_getIncludeParameters($construction[2]);
122+
$value = isset($construction[2]) ? $construction[2] : '';
123+
$params = $this->_getIncludeParameters($value);
123124
return $this->_storeManager->getStore()
124125
->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $params['url'];
125126
}

dev/tests/unit/testsuite/Magento/Widget/Model/Template/FilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function testMediaDirective()
1818
/** @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject $storeMock */
1919
$storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false);
2020
$storeMock->expects($this->once())->method('getBaseUrl')->with(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA)
21-
->will($this->returnValue($baseUrl));
21+
->willReturn($baseUrl);
2222

2323
/** @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject $storeManagerMock */
2424
$storeManagerMock = $this->getMock('Magento\Framework\Store\StoreManagerInterface', [], [], '', false);

0 commit comments

Comments
 (0)