Skip to content

Commit 1e9a3ec

Browse files
committed
Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-67087
2 parents ed38305 + 0aa7656 commit 1e9a3ec

File tree

11 files changed

+78
-85
lines changed

11 files changed

+78
-85
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/Checkout/view/frontend/web/js/checkout-data.js

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ define([
3131

3232
if ($.isEmptyObject(data)) {
3333
data = {
34-
'selectedShippingAddress': null,
35-
'shippingAddressFromData': null,
36-
'newCustomerShippingAddress': null,
37-
'selectedShippingRate': null,
38-
'selectedPaymentMethod': null,
39-
'selectedBillingAddress': null,
40-
'billingAddressFormData': null,
41-
'newCustomerBillingAddress': null
34+
'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage
35+
'shippingAddressFromData': null, //Shipping address pulled from persistence storage
36+
'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for customer
37+
'selectedShippingRate': null, //Shipping rate pulled from persistence storage
38+
'selectedPaymentMethod': null, //Payment method pulled from persistence storage
39+
'selectedBillingAddress': null, //Selected billing address pulled from persistence storage
40+
'billingAddressFromData': null, //Billing address pulled from persistence storage
41+
'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer
4242
};
4343
saveData(data);
4444
}
@@ -48,6 +48,8 @@ define([
4848

4949
return {
5050
/**
51+
* Setting the selected shipping address pulled from persistence storage
52+
*
5153
* @param {Object} data
5254
*/
5355
setSelectedShippingAddress: function (data) {
@@ -58,13 +60,17 @@ define([
5860
},
5961

6062
/**
63+
* Pulling the selected shipping address from persistence storage
64+
*
6165
* @return {*}
6266
*/
6367
getSelectedShippingAddress: function () {
6468
return getData().selectedShippingAddress;
6569
},
6670

6771
/**
72+
* Setting the shipping address pulled from persistence storage
73+
*
6874
* @param {Object} data
6975
*/
7076
setShippingAddressFromData: function (data) {
@@ -75,13 +81,17 @@ define([
7581
},
7682

7783
/**
84+
* Pulling the shipping address from persistence storage
85+
*
7886
* @return {*}
7987
*/
8088
getShippingAddressFromData: function () {
8189
return getData().shippingAddressFromData;
8290
},
8391

8492
/**
93+
* Setting the shipping address pulled from persistence storage for new customer
94+
*
8595
* @param {Object} data
8696
*/
8797
setNewCustomerShippingAddress: function (data) {
@@ -92,13 +102,17 @@ define([
92102
},
93103

94104
/**
105+
* Pulling the shipping address from persistence storage for new customer
106+
*
95107
* @return {*}
96108
*/
97109
getNewCustomerShippingAddress: function () {
98110
return getData().newCustomerShippingAddress;
99111
},
100112

101113
/**
114+
* Setting the selected shipping rate pulled from persistence storage
115+
*
102116
* @param {Object} data
103117
*/
104118
setSelectedShippingRate: function (data) {
@@ -109,13 +123,17 @@ define([
109123
},
110124

111125
/**
126+
* Pulling the selected shipping rate from local storage
127+
*
112128
* @return {*}
113129
*/
114130
getSelectedShippingRate: function () {
115131
return getData().selectedShippingRate;
116132
},
117133

118134
/**
135+
* Setting the selected payment method pulled from persistence storage
136+
*
119137
* @param {Object} data
120138
*/
121139
setSelectedPaymentMethod: function (data) {
@@ -126,13 +144,17 @@ define([
126144
},
127145

128146
/**
147+
* Pulling the payment method from persistence storage
148+
*
129149
* @return {*}
130150
*/
131151
getSelectedPaymentMethod: function () {
132152
return getData().selectedPaymentMethod;
133153
},
134154

135155
/**
156+
* Setting the selected billing address pulled from persistence storage
157+
*
136158
* @param {Object} data
137159
*/
138160
setSelectedBillingAddress: function (data) {
@@ -143,13 +165,17 @@ define([
143165
},
144166

145167
/**
168+
* Pulling the selected billing address from persistence storage
169+
*
146170
* @return {*}
147171
*/
148172
getSelectedBillingAddress: function () {
149173
return getData().selectedBillingAddress;
150174
},
151175

152176
/**
177+
* Setting the billing address pulled from persistence storage
178+
*
153179
* @param {Object} data
154180
*/
155181
setBillingAddressFromData: function (data) {
@@ -160,13 +186,17 @@ define([
160186
},
161187

162188
/**
189+
* Pulling the billing address from persistence storage
190+
*
163191
* @return {*}
164192
*/
165193
getBillingAddressFromData: function () {
166194
return getData().billingAddressFromData;
167195
},
168196

169197
/**
198+
* Setting the billing address pulled from persistence storage for new customer
199+
*
170200
* @param {Object} data
171201
*/
172202
setNewCustomerBillingAddress: function (data) {
@@ -177,13 +207,17 @@ define([
177207
},
178208

179209
/**
210+
* Pulling the billing address from persistence storage for new customer
211+
*
180212
* @return {*}
181213
*/
182214
getNewCustomerBillingAddress: function () {
183215
return getData().newCustomerBillingAddress;
184216
},
185217

186218
/**
219+
* Pulling the email address from persistence storage
220+
*
187221
* @return {*}
188222
*/
189223
getValidatedEmailValue: function () {
@@ -193,6 +227,8 @@ define([
193227
},
194228

195229
/**
230+
* Setting the email address pulled from persistence storage
231+
*
196232
* @param {String} email
197233
*/
198234
setValidatedEmailValue: function (email) {
@@ -203,6 +239,8 @@ define([
203239
},
204240

205241
/**
242+
* Pulling the email input field value from persistence storage
243+
*
206244
* @return {*}
207245
*/
208246
getInputFieldEmailValue: function () {
@@ -212,6 +250,8 @@ define([
212250
},
213251

214252
/**
253+
* Setting the email input field value pulled from persistence storage
254+
*
215255
* @param {String} email
216256
*/
217257
setInputFieldEmailValue: function (email) {

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/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ abstract class AbstractFrontend implements \Magento\Eav\Model\Entity\Attribute\F
6868
* @param CacheInterface $cache
6969
* @param $storeResolver @deprecated
7070
* @param array $cacheTags
71-
* @param Serializer $serializer
7271
* @param StoreManagerInterface $storeManager
72+
* @param Serializer $serializer
7373
* @codeCoverageIgnore
7474
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7575
*/
@@ -78,8 +78,8 @@ public function __construct(
7878
CacheInterface $cache = null,
7979
$storeResolver = null,
8080
array $cacheTags = null,
81-
Serializer $serializer = null,
82-
StoreManagerInterface $storeManager = null
81+
StoreManagerInterface $storeManager = null,
82+
Serializer $serializer = null
8383
) {
8484
$this->_attrBooleanFactory = $attrBooleanFactory;
8585
$this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class);

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)) {

0 commit comments

Comments
 (0)