Skip to content

Commit 418ba2d

Browse files
committed
changes for implementation
1 parent ab80b22 commit 418ba2d

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Extended.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba
8787
protected $_massactionIdFilter;
8888

8989
/**
90+
* Massaction block name
91+
*
9092
* @var string
9193
*/
9294
protected $_massactionBlockName = \Magento\Backend\Block\Widget\Grid\Massaction\Extended::class;
@@ -120,6 +122,8 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba
120122
protected $_headersVisibility = true;
121123

122124
/**
125+
* Filter visibility
126+
*
123127
* @var boolean
124128
*/
125129
protected $_filterVisibility = true;
@@ -144,11 +148,15 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba
144148
protected $_isCollapsed;
145149

146150
/**
151+
* Count subtotals
152+
*
147153
* @var boolean
148154
*/
149155
protected $_countSubTotals = false;
150156

151157
/**
158+
* SubTotals
159+
*
152160
* @var \Magento\Framework\DataObject[]
153161
*/
154162
protected $_subtotals = [];
@@ -956,7 +964,6 @@ public function _exportIterateCollection($callback, array $args)
956964

957965
while ($break !== true) {
958966
$collection = clone $originalCollection;
959-
$collection->clear();
960967
$collection->setPageSize($this->_exportPageSize);
961968
$collection->setCurPage($page);
962969
$collection->load();
@@ -968,6 +975,7 @@ public function _exportIterateCollection($callback, array $args)
968975
$break = true;
969976
}
970977
$page++;
978+
971979
foreach ($collection as $item) {
972980
//phpcs:ignore Magento2.Functions.DiscouragedFunction
973981
call_user_func_array(

app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart/ExportAbandonedCsv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function execute()
2828
$fileName = 'shopcart_abandoned.csv';
2929
$content = $this->_view->getLayout()->createBlock(
3030
\Magento\Reports\Block\Adminhtml\Shopcart\Abandoned\Grid::class
31-
)->getCsvFile();
31+
)->getCsv();
3232

3333
return $this->_fileFactory->create($fileName, $content, DirectoryList::VAR_DIR);
3434
}

app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,9 @@ public function resolveCustomerNames()
200200
foreach ($this->getItems() as $item) {
201201
foreach ($customersData as $customerItemData) {
202202
if ($item['customer_id'] == $customerItemData['entity_id']) {
203-
$item->setData('customer_name', $customerItemData['customer_name']);
204-
$item->setData('email', $customerItemData['email']);
205-
$item->setData($item->getData());
203+
$item->setData(array_merge($item->getData(), $customerItemData));
206204
}
207205
}
208206
}
209207
}
210-
211-
/**
212-
* Append customer data after collection load
213-
*
214-
* @return Collection|void
215-
*/
216-
protected function _afterLoad()
217-
{
218-
parent::_afterLoad();
219-
$this->resolveCustomerNames();
220-
}
221208
}

app/code/Magento/Reports/Test/Unit/Controller/Adminhtml/Report/Shopcart/ExportAbandonedCsvTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testExecute()
4545

4646
$this->abstractBlockMock
4747
->expects($this->once())
48-
->method('getCsvFile')
48+
->method('getCsv')
4949
->willReturn($content);
5050

5151
$this->layoutMock

app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Quote/CollectionTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,41 +131,41 @@ public function testResolveCustomerNames()
131131
$this->selectMock->expects($this->any())
132132
->method('getConnection')
133133
->willReturn($this->connectionMock);
134-
$this->selectMock->expects($this->atLeastOnce())
134+
$this->selectMock->expects($this->once())
135135
->method('from')
136136
->with(['customer' => $customerTableName], ['entity_id', 'email'])
137137
->willReturnSelf();
138-
$this->selectMock->expects($this->atLeastOnce())
138+
$this->selectMock->expects($this->once())
139139
->method('columns')
140140
->with(['customer_name' => $customerName])
141141
->willReturnSelf();
142-
$this->selectMock->expects($this->atLeastOnce())
142+
$this->selectMock->expects($this->once())
143143
->method('where')
144144
->with('customer.entity_id IN (?)')
145145
->willReturnSelf();
146146

147-
$this->connectionMock->expects($this->atLeastOnce())
147+
$this->connectionMock->expects($this->once())
148148
->method('getConcatSql')
149149
->with(['firstname', 'lastname'], ' ')
150150
->willReturn($customerName);
151151

152152
$this->customerResourceMock->expects($this->any())
153153
->method('getConnection')
154154
->willReturn($this->connectionMock);
155-
$this->customerResourceMock->expects($this->atLeastOnce())
155+
$this->customerResourceMock->expects($this->once())
156156
->method('getTable')
157157
->with('customer_entity')
158158
->willReturn($customerTableName);
159159

160160
$this->connectionMock->expects($this->any())
161161
->method('select')
162162
->willReturn($this->selectMock);
163-
$this->connectionMock->expects($this->atLeastOnce())
163+
$this->connectionMock->expects($this->once())
164164
->method('fetchAll')
165165
->with($this->selectMock)
166166
->willReturn($customersData);
167167

168-
$this->fetchStrategyMock->expects($this->atLeastOnce())
168+
$this->fetchStrategyMock->expects($this->once())
169169
->method('fetchAll')
170170
->withAnyParameters()
171171
->willReturn($customerId);

0 commit comments

Comments
 (0)