Skip to content

Commit 2c52e17

Browse files
committed
Merge pull request #133 from magento-troll/develop
[Troll] Bugfixes
2 parents 91b710e + 499220a commit 2c52e17

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

app/code/Magento/Reports/Model/Resource/Product/Collection.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,7 @@ public function addViewsCount($from = '', $to = '')
434434
['views' => 'COUNT(report_table_views.event_id)']
435435
)->join(
436436
['e' => $this->getProductEntityTableName()],
437-
$this->getConnection()->quoteInto(
438-
"e.entity_id = report_table_views.object_id AND e.entity_type_id = ?",
439-
$this->getProductEntityTypeId()
440-
)
437+
'e.entity_id = report_table_views.object_id'
441438
)->where(
442439
'report_table_views.event_type_id = ?',
443440
$productViewEvent
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
*
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
8+
9+
class ProductsViewedTest extends \Magento\Backend\Utility\Controller
10+
{
11+
/**
12+
* @magentoDataFixture Magento/Reports/_files/viewed_products.php
13+
*/
14+
public function testExecute()
15+
{
16+
$this->dispatch('backend/admin/dashboard/productsViewed/');
17+
18+
$this->assertEquals(200, $this->getResponse()->getHttpResponseCode());
19+
20+
$actual = $this->getResponse()->getBody();
21+
$this->assertContains('Simple Product', $actual);
22+
}
23+
}

0 commit comments

Comments
 (0)