Skip to content

Commit

Permalink
Merge pull request #1186 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests:
#9157
#7405
#9824
#9810
#9823
#7780
  • Loading branch information
Oleksii Korshenko authored Jun 12, 2017
2 parents d1b86ae + 268b217 commit e2feb2e
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 74 deletions.
16 changes: 8 additions & 8 deletions app/code/Magento/CatalogImportExport/Model/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1228,15 +1228,15 @@ protected function _saveLinks()
'linked_product_id' => $linkedId,
'link_type_id' => $linkId,
];
if (!empty($linkPositions[$linkedKey])) {
$positionRows[] = [
'link_id' => $productLinkKeys[$linkKey],
'product_link_attribute_id' => $positionAttrId[$linkId],
'value' => $linkPositions[$linkedKey],
];
}
$nextLinkId++;
}
if (!empty($linkPositions[$linkedKey])) {
$positionRows[] = [
'link_id' => $productLinkKeys[$linkKey],
'product_link_attribute_id' => $positionAttrId[$linkId],
'value' => $linkPositions[$linkedKey],
];
}
$nextLinkId++;
}
}
}
Expand Down
17 changes: 1 addition & 16 deletions app/code/Magento/Cms/Model/BlockRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria

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

$blocks = [];
/** @var Block $blockModel */
foreach ($collection as $blockModel) {
$blockData = $this->dataBlockFactory->create();
$this->dataObjectHelper->populateWithArray(
$blockData,
$blockModel->getData(),
\Magento\Cms\Api\Data\BlockInterface::class
);
$blocks[] = $this->dataObjectProcessor->buildOutputDataArray(
$blockData,
\Magento\Cms\Api\Data\BlockInterface::class
);
}

/** @var Data\BlockSearchResultsInterface $searchResults */
$searchResults = $this->searchResultsFactory->create();
$searchResults->setSearchCriteria($criteria);
$searchResults->setItems($blocks);
$searchResults->setItems($collection->getItems());
$searchResults->setTotalCount($collection->getSize());
return $searchResults;
}
Expand Down
17 changes: 1 addition & 16 deletions app/code/Magento/Cms/Model/PageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,25 +157,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria

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

$pages = [];
/** @var Page $pageModel */
foreach ($collection as $pageModel) {
$pageData = $this->dataPageFactory->create();
$this->dataObjectHelper->populateWithArray(
$pageData,
$pageModel->getData(),
\Magento\Cms\Api\Data\PageInterface::class
);
$pages[] = $this->dataObjectProcessor->buildOutputDataArray(
$pageData,
\Magento\Cms\Api\Data\PageInterface::class
);
}

/** @var Data\PageSearchResultsInterface $searchResults */
$searchResults = $this->searchResultsFactory->create();
$searchResults->setSearchCriteria($criteria);
$searchResults->setItems($pages);
$searchResults->setItems($collection->getItems());
$searchResults->setTotalCount($collection->getSize());
return $searchResults;
}
Expand Down
16 changes: 1 addition & 15 deletions app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,8 @@ public function testGetList()
->willReturnSelf();
$this->blockSearchResult->expects($this->once())
->method('setItems')
->with(['someData'])
->with([$this->block])
->willReturnSelf();

$this->block->expects($this->once())
->method('getData')
->willReturn(['data']);

$this->dataHelper->expects($this->once())
->method('populateWithArray')
->with($this->blockData, ['data'], \Magento\Cms\Api\Data\BlockInterface::class);

$this->dataObjectProcessor->expects($this->once())
->method('buildOutputDataArray')
->with($this->blockData, \Magento\Cms\Api\Data\BlockInterface::class)
->willReturn('someData');

$this->assertEquals($this->blockSearchResult, $this->repository->getList($criteria));
}
}
16 changes: 1 addition & 15 deletions app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,22 +261,8 @@ public function testGetList()
->willReturnSelf();
$this->pageSearchResult->expects($this->once())
->method('setItems')
->with(['someData'])
->with([$this->page])
->willReturnSelf();

$this->page->expects($this->once())
->method('getData')
->willReturn(['data']);

$this->dataHelper->expects($this->once())
->method('populateWithArray')
->with($this->pageData, ['data'], \Magento\Cms\Api\Data\PageInterface::class);

$this->dataObjectProcessor->expects($this->once())
->method('buildOutputDataArray')
->with($this->pageData, \Magento\Cms\Api\Data\PageInterface::class)
->willReturn('someData');

$this->assertEquals($this->pageSearchResult, $this->repository->getList($criteria));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\SendFriend\Block\Send" name="sendfriend.send" template="Magento_SendFriend::send.phtml"/>
<block class="Magento\SendFriend\Block\Send" name="sendfriend.send" template="Magento_SendFriend::send.phtml">
<container name="form.additional.info" as="form_additional_info"/>
</block>
</referenceContainer>
</body>
</page>
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<?php endif; ?>
</div>
</div>
<?php echo $block->getChildHtml('form_additional_info'); ?>
</fieldset>
<div class="actions-toolbar">
<div class="primary">
Expand Down
8 changes: 5 additions & 3 deletions lib/internal/Magento/Framework/HTTP/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,14 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true);
if ($method == \Zend_Http_Client::POST) {
curl_setopt($this->_getResource(), CURLOPT_POST, true);
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
} elseif ($method == \Zend_Http_Client::GET) {
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
} elseif ($method == \Zend_Http_Client::PUT) {
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, \Zend_Http_Client::PUT);
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
} elseif ($method == \Zend_Http_Client::GET) {
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
}

if (is_array($headers)) {
Expand Down
6 changes: 6 additions & 0 deletions setup/src/Magento/Setup/Module/Di/Compiler/Log/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ public function add($type, $key, $message = '')
* Write entries
*
* @return void
* @throws \Magento\Framework\Validator\Exception
*/
public function report()
{
$this->_successWriter->write($this->_successEntries);
$this->_errorWriter->write($this->_errorEntries);
//do not take into account empty items since they are initialized in constructor.
$errors = array_filter($this->_errorEntries);
if (count($errors) > 0) {
throw new \Magento\Framework\Validator\Exception(__('Error during compilation'));
}
}

/**
Expand Down

0 comments on commit e2feb2e

Please sign in to comment.