Skip to content

Commit e2feb2e

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1186 from magento-engcom/develop-prs
Public Pull Requests: #9157 #7405 #9824 #9810 #9823 #7780
2 parents d1b86ae + 268b217 commit e2feb2e

File tree

9 files changed

+27
-74
lines changed

9 files changed

+27
-74
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,15 +1228,15 @@ protected function _saveLinks()
12281228
'linked_product_id' => $linkedId,
12291229
'link_type_id' => $linkId,
12301230
];
1231-
if (!empty($linkPositions[$linkedKey])) {
1232-
$positionRows[] = [
1233-
'link_id' => $productLinkKeys[$linkKey],
1234-
'product_link_attribute_id' => $positionAttrId[$linkId],
1235-
'value' => $linkPositions[$linkedKey],
1236-
];
1237-
}
1238-
$nextLinkId++;
12391231
}
1232+
if (!empty($linkPositions[$linkedKey])) {
1233+
$positionRows[] = [
1234+
'link_id' => $productLinkKeys[$linkKey],
1235+
'product_link_attribute_id' => $positionAttrId[$linkId],
1236+
'value' => $linkPositions[$linkedKey],
1237+
];
1238+
}
1239+
$nextLinkId++;
12401240
}
12411241
}
12421242
}

app/code/Magento/Cms/Model/BlockRepository.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria
154154

155155
$this->collectionProcessor->process($criteria, $collection);
156156

157-
$blocks = [];
158-
/** @var Block $blockModel */
159-
foreach ($collection as $blockModel) {
160-
$blockData = $this->dataBlockFactory->create();
161-
$this->dataObjectHelper->populateWithArray(
162-
$blockData,
163-
$blockModel->getData(),
164-
\Magento\Cms\Api\Data\BlockInterface::class
165-
);
166-
$blocks[] = $this->dataObjectProcessor->buildOutputDataArray(
167-
$blockData,
168-
\Magento\Cms\Api\Data\BlockInterface::class
169-
);
170-
}
171-
172157
/** @var Data\BlockSearchResultsInterface $searchResults */
173158
$searchResults = $this->searchResultsFactory->create();
174159
$searchResults->setSearchCriteria($criteria);
175-
$searchResults->setItems($blocks);
160+
$searchResults->setItems($collection->getItems());
176161
$searchResults->setTotalCount($collection->getSize());
177162
return $searchResults;
178163
}

app/code/Magento/Cms/Model/PageRepository.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria
157157

158158
$this->collectionProcessor->process($criteria, $collection);
159159

160-
$pages = [];
161-
/** @var Page $pageModel */
162-
foreach ($collection as $pageModel) {
163-
$pageData = $this->dataPageFactory->create();
164-
$this->dataObjectHelper->populateWithArray(
165-
$pageData,
166-
$pageModel->getData(),
167-
\Magento\Cms\Api\Data\PageInterface::class
168-
);
169-
$pages[] = $this->dataObjectProcessor->buildOutputDataArray(
170-
$pageData,
171-
\Magento\Cms\Api\Data\PageInterface::class
172-
);
173-
}
174-
175160
/** @var Data\PageSearchResultsInterface $searchResults */
176161
$searchResults = $this->searchResultsFactory->create();
177162
$searchResults->setSearchCriteria($criteria);
178-
$searchResults->setItems($pages);
163+
$searchResults->setItems($collection->getItems());
179164
$searchResults->setTotalCount($collection->getSize());
180165
return $searchResults;
181166
}

app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -263,22 +263,8 @@ public function testGetList()
263263
->willReturnSelf();
264264
$this->blockSearchResult->expects($this->once())
265265
->method('setItems')
266-
->with(['someData'])
266+
->with([$this->block])
267267
->willReturnSelf();
268-
269-
$this->block->expects($this->once())
270-
->method('getData')
271-
->willReturn(['data']);
272-
273-
$this->dataHelper->expects($this->once())
274-
->method('populateWithArray')
275-
->with($this->blockData, ['data'], \Magento\Cms\Api\Data\BlockInterface::class);
276-
277-
$this->dataObjectProcessor->expects($this->once())
278-
->method('buildOutputDataArray')
279-
->with($this->blockData, \Magento\Cms\Api\Data\BlockInterface::class)
280-
->willReturn('someData');
281-
282268
$this->assertEquals($this->blockSearchResult, $this->repository->getList($criteria));
283269
}
284270
}

app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -261,22 +261,8 @@ public function testGetList()
261261
->willReturnSelf();
262262
$this->pageSearchResult->expects($this->once())
263263
->method('setItems')
264-
->with(['someData'])
264+
->with([$this->page])
265265
->willReturnSelf();
266-
267-
$this->page->expects($this->once())
268-
->method('getData')
269-
->willReturn(['data']);
270-
271-
$this->dataHelper->expects($this->once())
272-
->method('populateWithArray')
273-
->with($this->pageData, ['data'], \Magento\Cms\Api\Data\PageInterface::class);
274-
275-
$this->dataObjectProcessor->expects($this->once())
276-
->method('buildOutputDataArray')
277-
->with($this->pageData, \Magento\Cms\Api\Data\PageInterface::class)
278-
->willReturn('someData');
279-
280266
$this->assertEquals($this->pageSearchResult, $this->repository->getList($criteria));
281267
}
282268
}

app/code/Magento/SendFriend/view/frontend/layout/sendfriend_product_send.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
</action>
1414
</referenceBlock>
1515
<referenceContainer name="content">
16-
<block class="Magento\SendFriend\Block\Send" name="sendfriend.send" template="Magento_SendFriend::send.phtml"/>
16+
<block class="Magento\SendFriend\Block\Send" name="sendfriend.send" template="Magento_SendFriend::send.phtml">
17+
<container name="form.additional.info" as="form_additional_info"/>
18+
</block>
1719
</referenceContainer>
1820
</body>
1921
</page>

app/code/Magento/SendFriend/view/frontend/templates/send.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
<?php endif; ?>
105105
</div>
106106
</div>
107+
<?php echo $block->getChildHtml('form_additional_info'); ?>
107108
</fieldset>
108109
<div class="actions-toolbar">
109110
<div class="primary">

lib/internal/Magento/Framework/HTTP/Adapter/Curl.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,14 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
173173
curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true);
174174
if ($method == \Zend_Http_Client::POST) {
175175
curl_setopt($this->_getResource(), CURLOPT_POST, true);
176+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'POST');
176177
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
177-
} elseif ($method == \Zend_Http_Client::GET) {
178-
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
179178
} elseif ($method == \Zend_Http_Client::PUT) {
180-
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, \Zend_Http_Client::PUT);
179+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT');
181180
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
181+
} elseif ($method == \Zend_Http_Client::GET) {
182+
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
183+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
182184
}
183185

184186
if (is_array($headers)) {

setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,17 @@ public function add($type, $key, $message = '')
8080
* Write entries
8181
*
8282
* @return void
83+
* @throws \Magento\Framework\Validator\Exception
8384
*/
8485
public function report()
8586
{
8687
$this->_successWriter->write($this->_successEntries);
8788
$this->_errorWriter->write($this->_errorEntries);
89+
//do not take into account empty items since they are initialized in constructor.
90+
$errors = array_filter($this->_errorEntries);
91+
if (count($errors) > 0) {
92+
throw new \Magento\Framework\Validator\Exception(__('Error during compilation'));
93+
}
8894
}
8995

9096
/**

0 commit comments

Comments
 (0)