Skip to content

Commit 5ce0592

Browse files
committed
Merge remote-tracking branch 'main-ce/develop' into MAGETWO-62783
2 parents 02ebb4d + c1478c9 commit 5ce0592

File tree

10 files changed

+84
-13
lines changed

10 files changed

+84
-13
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,16 +2195,22 @@ public function addMediaGalleryData()
21952195
$linkField = $this->getProductEntityMetadata()->getLinkField();
21962196
$items = $this->getItems();
21972197

2198-
$select->where('entity.' . $linkField . ' IN (?)', array_map(function ($item) {
2199-
return $item->getId();
2200-
}, $items));
2201-
2198+
$select->where(
2199+
'entity.' . $linkField . ' IN (?)',
2200+
array_map(
2201+
function ($item) use ($linkField) {
2202+
return $item->getData($linkField);
2203+
},
2204+
$items
2205+
)
2206+
);
22022207
foreach ($this->getConnection()->fetchAll($select) as $row) {
22032208
$mediaGalleries[$row[$linkField]][] = $row;
22042209
}
22052210

22062211
foreach ($items as $item) {
2207-
$mediaEntries = isset($mediaGalleries[$item->getId()]) ? $mediaGalleries[$item->getId()] : [];
2212+
$mediaEntries = isset($mediaGalleries[$item->getData($linkField)]) ?
2213+
$mediaGalleries[$item->getData($linkField)] : [];
22082214
$this->getGalleryReadHandler()->addMediaDataToProduct($item, $mediaEntries);
22092215
}
22102216

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ public function testAddProductCategoriesFilter()
224224
public function testAddMediaGalleryData()
225225
{
226226
$attributeId = 42;
227-
$itemId = 4242;
228-
$linkField = 'entity_id';
229-
$mediaGalleriesMock = [[$linkField => $itemId]];
227+
$rowId = 4;
228+
$linkField = 'row_id';
229+
$mediaGalleriesMock = [[$linkField => $rowId]];
230230
$itemMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
231231
->disableOriginalConstructor()
232+
->setMethods(['getData'])
232233
->getMock();
233234
$attributeMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class)
234235
->disableOriginalConstructor()
@@ -248,13 +249,13 @@ public function testAddMediaGalleryData()
248249
$this->galleryResourceMock->expects($this->once())->method('createBatchBaseSelect')->willReturn($selectMock);
249250
$attributeMock->expects($this->once())->method('getAttributeId')->willReturn($attributeId);
250251
$this->entityMock->expects($this->once())->method('getAttribute')->willReturn($attributeMock);
251-
$itemMock->expects($this->atLeastOnce())->method('getId')->willReturn($itemId);
252-
$selectMock->expects($this->once())->method('where')->with('entity.' . $linkField . ' IN (?)', [$itemId]);
252+
$itemMock->expects($this->atLeastOnce())->method('getData')->willReturn($rowId);
253+
$selectMock->expects($this->once())->method('where')->with('entity.' . $linkField . ' IN (?)', [$rowId]);
253254
$this->metadataPoolMock->expects($this->once())->method('getMetadata')->willReturn($metadataMock);
254255
$metadataMock->expects($this->once())->method('getLinkField')->willReturn($linkField);
255256

256257
$this->connectionMock->expects($this->once())->method('fetchAll')->with($selectMock)->willReturn(
257-
[['entity_id' => $itemId]]
258+
[['row_id' => $rowId]]
258259
);
259260
$this->galleryReadHandlerMock->expects($this->once())->method('addMediaDataToProduct')
260261
->with($itemMock, $mediaGalleriesMock);

app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<block class="Magento\Sales\Block\Adminhtml\Order\View\Tab\Info" name="order_tab_info" template="order/view/tab/info.phtml">
2424
<block class="Magento\Sales\Block\Adminhtml\Order\View\Messages" name="order_messages"/>
2525
<block class="Magento\Sales\Block\Adminhtml\Order\View\Info" name="order_info" template="order/view/info.phtml"/>
26+
<container name="order_additional_info"/>
2627
<block class="Magento\Sales\Block\Adminhtml\Order\View\Items" name="order_items" template="order/view/items.phtml">
2728
<arguments>
2829
<argument name="columns" xsi:type="array">

app/code/Magento/Sales/view/adminhtml/templates/order/view/tab/info.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
</div>
4141
</section>
4242

43+
<?php echo $block->getChildHtml('order_additional_info') ?>
44+
4345
<?php echo $block->getGiftOptionsHtml() ?>
4446

4547
<section class="admin__page-section">
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// /**
2+
// * Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Order Case Info
8+
// ---------------------------------------------
9+
10+
.order-case-table {
11+
&:extend(.abs-order-tables all);
12+
&:extend(.abs-order-tbody-border all);
13+
}

app/etc/di.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<preference for="Magento\Framework\Search\Adapter\Mysql\Field\FieldInterface" type="Magento\Framework\Search\Adapter\Mysql\Field\Field"/>
1919
<preference for="Magento\Framework\Search\Adapter\Aggregation\AggregationResolverInterface" type="Magento\Framework\Search\Adapter\Aggregation\AggregationResolver"/>
2020
<preference for="Magento\Framework\App\RequestInterface" type="Magento\Framework\App\Request\Http" />
21+
<preference for="Magento\Framework\App\PlainTextRequestInterface" type="Magento\Framework\App\Request\Http" />
22+
<preference for="Magento\Framework\App\RequestContentInterface" type="Magento\Framework\App\Request\Http" />
2123
<preference for="Magento\Framework\App\Request\PathInfoProcessorInterface" type="Magento\Store\App\Request\PathInfoProcessor" />
2224
<preference for="Magento\Framework\App\ResponseInterface" type="Magento\Framework\App\Response\Http" />
2325
<preference for="Magento\Framework\App\RouterListInterface" type="Magento\Framework\App\RouterList" />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Framework\App;
7+
8+
/**
9+
* Interface provides low-level access to Magento Application Request and represent it as a simple string.
10+
* This interface does not define format of the request content.
11+
* Clients of this interface must be able to validate syntax of request and parse it.
12+
*
13+
* To read already parsed request data use \Magento\Framework\App\RequestInterface.
14+
*
15+
* @api
16+
*/
17+
interface PlainTextRequestInterface
18+
{
19+
/**
20+
* Returns textual representation of request to Magento.
21+
*
22+
* @return string
23+
*/
24+
public function getContent();
25+
}

lib/internal/Magento/Framework/App/Request/Http.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Framework\App\Request;
77

8-
use Magento\Framework\App\RequestInterface;
8+
use Magento\Framework\App\RequestContentInterface;
99
use Magento\Framework\App\RequestSafetyInterface;
1010
use Magento\Framework\App\Route\ConfigInterface\Proxy as ConfigInterface;
1111
use Magento\Framework\HTTP\PhpEnvironment\Request;
@@ -16,7 +16,7 @@
1616
/**
1717
* Http request
1818
*/
19-
class Http extends Request implements RequestInterface, RequestSafetyInterface
19+
class Http extends Request implements RequestContentInterface, RequestSafetyInterface
2020
{
2121
/**#@+
2222
* HTTP Ports
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Framework\App;
7+
8+
/**
9+
* Interface provides access to parsed request data as well as to the request textual representation.
10+
* This interface exists to provide backward compatibility.
11+
* Direct usage of RequestInterface and PlainTextRequestInterface is preferable.
12+
*
13+
* @api
14+
*/
15+
interface RequestContentInterface extends RequestInterface, PlainTextRequestInterface
16+
{
17+
18+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
178178
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
179179
} elseif ($method == \Zend_Http_Client::GET) {
180180
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
181+
} elseif ($method == \Zend_Http_Client::PUT) {
182+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, \Zend_Http_Client::PUT);
183+
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
181184
}
182185

183186
if (is_array($headers)) {

0 commit comments

Comments
 (0)