Skip to content

Commit f13a71a

Browse files
MC-5545: RSS feed works only from cache
1 parent 4ee3bb3 commit f13a71a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Rss/NotifyStock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ protected function _construct()
5454
*/
5555
public function getRssData()
5656
{
57-
$newUrl = $this->rssUrlBuilder->getUrl(['_secure' => true, '_nosecret' => true, 'type' => 'notifystock']);
58-
$title = __('Low Stock Products');
57+
$newUrl = $this->rssUrlBuilder->getUrl(['_secure' => true, '_nosecret' => true, 'type' => 'notifystock']);
58+
$title = __('Low Stock Products')->render();
5959
$data = ['title' => $title, 'description' => $title, 'link' => $newUrl, 'charset' => 'UTF-8'];
6060

6161
foreach ($this->rssModel->getProductsCollection() as $item) {
@@ -65,7 +65,7 @@ public function getRssData()
6565
['id' => $item->getId(), '_secure' => true, '_nosecret' => true]
6666
);
6767
$qty = 1 * $item->getQty();
68-
$description = __('%1 has reached a quantity of %2.', $item->getName(), $qty);
68+
$description = __('%1 has reached a quantity of %2.', $item->getName(), $qty)->render();
6969
$data['entries'][] = ['title' => $item->getName(), 'link' => $url, 'description' => $description];
7070
}
7171

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Rss/NotifyStockTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ public function testGetRssData()
9696
$this->urlBuilder->expects($this->once())->method('getUrl')
9797
->with('catalog/product/edit', ['id' => 1, '_secure' => true, '_nosecret' => true])
9898
->will($this->returnValue('http://magento.com/catalog/product/edit/id/1'));
99-
$this->assertEquals($this->rssFeed, $this->block->getRssData());
99+
100+
$data = $this->block->getRssData();
101+
$this->assertTrue(is_string($data['title']));
102+
$this->assertTrue(is_string($data['description']));
103+
$this->assertTrue(is_string($data['entries'][0]['description']));
104+
$this->assertEquals($this->rssFeed, $data);
100105
}
101106

102107
public function testGetCacheLifetime()

0 commit comments

Comments
 (0)