Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-…
Browse files Browse the repository at this point in the history
…67087
  • Loading branch information
slopukhov committed Jun 13, 2017
2 parents ed38305 + 0aa7656 commit 1e9a3ec
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 85 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
56 changes: 48 additions & 8 deletions app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ define([

if ($.isEmptyObject(data)) {
data = {
'selectedShippingAddress': null,
'shippingAddressFromData': null,
'newCustomerShippingAddress': null,
'selectedShippingRate': null,
'selectedPaymentMethod': null,
'selectedBillingAddress': null,
'billingAddressFormData': null,
'newCustomerBillingAddress': null
'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage
'shippingAddressFromData': null, //Shipping address pulled from persistence storage
'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for customer
'selectedShippingRate': null, //Shipping rate pulled from persistence storage
'selectedPaymentMethod': null, //Payment method pulled from persistence storage
'selectedBillingAddress': null, //Selected billing address pulled from persistence storage
'billingAddressFromData': null, //Billing address pulled from persistence storage
'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer
};
saveData(data);
}
Expand All @@ -48,6 +48,8 @@ define([

return {
/**
* Setting the selected shipping address pulled from persistence storage
*
* @param {Object} data
*/
setSelectedShippingAddress: function (data) {
Expand All @@ -58,13 +60,17 @@ define([
},

/**
* Pulling the selected shipping address from persistence storage
*
* @return {*}
*/
getSelectedShippingAddress: function () {
return getData().selectedShippingAddress;
},

/**
* Setting the shipping address pulled from persistence storage
*
* @param {Object} data
*/
setShippingAddressFromData: function (data) {
Expand All @@ -75,13 +81,17 @@ define([
},

/**
* Pulling the shipping address from persistence storage
*
* @return {*}
*/
getShippingAddressFromData: function () {
return getData().shippingAddressFromData;
},

/**
* Setting the shipping address pulled from persistence storage for new customer
*
* @param {Object} data
*/
setNewCustomerShippingAddress: function (data) {
Expand All @@ -92,13 +102,17 @@ define([
},

/**
* Pulling the shipping address from persistence storage for new customer
*
* @return {*}
*/
getNewCustomerShippingAddress: function () {
return getData().newCustomerShippingAddress;
},

/**
* Setting the selected shipping rate pulled from persistence storage
*
* @param {Object} data
*/
setSelectedShippingRate: function (data) {
Expand All @@ -109,13 +123,17 @@ define([
},

/**
* Pulling the selected shipping rate from local storage
*
* @return {*}
*/
getSelectedShippingRate: function () {
return getData().selectedShippingRate;
},

/**
* Setting the selected payment method pulled from persistence storage
*
* @param {Object} data
*/
setSelectedPaymentMethod: function (data) {
Expand All @@ -126,13 +144,17 @@ define([
},

/**
* Pulling the payment method from persistence storage
*
* @return {*}
*/
getSelectedPaymentMethod: function () {
return getData().selectedPaymentMethod;
},

/**
* Setting the selected billing address pulled from persistence storage
*
* @param {Object} data
*/
setSelectedBillingAddress: function (data) {
Expand All @@ -143,13 +165,17 @@ define([
},

/**
* Pulling the selected billing address from persistence storage
*
* @return {*}
*/
getSelectedBillingAddress: function () {
return getData().selectedBillingAddress;
},

/**
* Setting the billing address pulled from persistence storage
*
* @param {Object} data
*/
setBillingAddressFromData: function (data) {
Expand All @@ -160,13 +186,17 @@ define([
},

/**
* Pulling the billing address from persistence storage
*
* @return {*}
*/
getBillingAddressFromData: function () {
return getData().billingAddressFromData;
},

/**
* Setting the billing address pulled from persistence storage for new customer
*
* @param {Object} data
*/
setNewCustomerBillingAddress: function (data) {
Expand All @@ -177,13 +207,17 @@ define([
},

/**
* Pulling the billing address from persistence storage for new customer
*
* @return {*}
*/
getNewCustomerBillingAddress: function () {
return getData().newCustomerBillingAddress;
},

/**
* Pulling the email address from persistence storage
*
* @return {*}
*/
getValidatedEmailValue: function () {
Expand All @@ -193,6 +227,8 @@ define([
},

/**
* Setting the email address pulled from persistence storage
*
* @param {String} email
*/
setValidatedEmailValue: function (email) {
Expand All @@ -203,6 +239,8 @@ define([
},

/**
* Pulling the email input field value from persistence storage
*
* @return {*}
*/
getInputFieldEmailValue: function () {
Expand All @@ -212,6 +250,8 @@ define([
},

/**
* Setting the email input field value pulled from persistence storage
*
* @param {String} email
*/
setInputFieldEmailValue: function (email) {
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 @@ -68,8 +68,8 @@ abstract class AbstractFrontend implements \Magento\Eav\Model\Entity\Attribute\F
* @param CacheInterface $cache
* @param $storeResolver @deprecated
* @param array $cacheTags
* @param Serializer $serializer
* @param StoreManagerInterface $storeManager
* @param Serializer $serializer
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
Expand All @@ -78,8 +78,8 @@ public function __construct(
CacheInterface $cache = null,
$storeResolver = null,
array $cacheTags = null,
Serializer $serializer = null,
StoreManagerInterface $storeManager = null
StoreManagerInterface $storeManager = null,
Serializer $serializer = null
) {
$this->_attrBooleanFactory = $attrBooleanFactory;
$this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class);
Expand Down
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
Loading

0 comments on commit 1e9a3ec

Please sign in to comment.