Skip to content

Commit c350871

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1248 from magento-engcom/develop-prs
Public Pull Requests #10052 #9992 #9726 #9754 #9611 #9363
2 parents 3eb0183 + 2de5e40 commit c350871

File tree

22 files changed

+150
-49
lines changed

22 files changed

+150
-49
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,16 @@ public function getGridIdsJson()
275275
if (!$this->getUseSelectAll()) {
276276
return '';
277277
}
278-
279278
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
280279
$allIdsCollection = clone $this->getParentBlock()->getCollection();
281-
$gridIds = $allIdsCollection->clear()->setPageSize(0)->getAllIds();
282-
280+
281+
if ($this->getMassactionIdField()) {
282+
$massActionIdField = $this->getMassactionIdField();
283+
} else {
284+
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
285+
}
286+
287+
$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
283288
if (!empty($gridIds)) {
284289
return join(",", $gridIds);
285290
}

app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,14 @@ public function getGridIdsJson()
274274

275275
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
276276
$allIdsCollection = clone $this->getParentBlock()->getCollection();
277-
$gridIds = $allIdsCollection->clear()->setPageSize(0)->getAllIds();
277+
278+
if ($this->getMassactionIdField()) {
279+
$massActionIdField = $this->getMassactionIdField();
280+
} else {
281+
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
282+
}
283+
284+
$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
278285

279286
if (!empty($gridIds)) {
280287
return join(",", $gridIds);

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Massaction/ExtendedTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ public function testGetGridIdsJsonWithoutUseSelectAll()
132132
public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
133133
{
134134
$this->_block->setUseSelectAll(true);
135-
135+
136+
if ($this->_block->getMassactionIdField()) {
137+
$massActionIdField = $this->_block->getMassactionIdField();
138+
} else {
139+
$massActionIdField = $this->_block->getParentBlock()->getMassactionIdField();
140+
}
141+
136142
$collectionMock = $this->getMockBuilder(\Magento\Framework\Data\Collection::class)
137143
->disableOriginalConstructor()
138144
->getMock();
@@ -141,15 +147,13 @@ public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
141147
->method('getCollection')
142148
->willReturn($collectionMock);
143149

144-
$collectionMock->expects($this->once())
145-
->method('clear')
146-
->willReturnSelf();
147150
$collectionMock->expects($this->once())
148151
->method('setPageSize')
149152
->with(0)
150153
->willReturnSelf();
151154
$collectionMock->expects($this->once())
152-
->method('getAllIds')
155+
->method('getColumnValues')
156+
->with($massActionIdField)
153157
->willReturn($items);
154158

155159
$this->assertEquals($result, $this->_block->getGridIdsJson());

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/MassactionTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ public function testGetGridIdsJsonWithoutUseSelectAll()
237237
public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
238238
{
239239
$this->_block->setUseSelectAll(true);
240+
241+
if ($this->_block->getMassactionIdField()) {
242+
$massActionIdField = $this->_block->getMassactionIdField();
243+
} else {
244+
$massActionIdField = $this->_block->getParentBlock()->getMassactionIdField();
245+
}
240246

241247
$collectionMock = $this->getMockBuilder(\Magento\Framework\Data\Collection::class)
242248
->disableOriginalConstructor()
@@ -245,16 +251,13 @@ public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
245251
$this->_gridMock->expects($this->once())
246252
->method('getCollection')
247253
->willReturn($collectionMock);
248-
249-
$collectionMock->expects($this->once())
250-
->method('clear')
251-
->willReturnSelf();
252254
$collectionMock->expects($this->once())
253255
->method('setPageSize')
254256
->with(0)
255257
->willReturnSelf();
256258
$collectionMock->expects($this->once())
257-
->method('getAllIds')
259+
->method('getColumnValues')
260+
->with($massActionIdField)
258261
->willReturn($items);
259262

260263
$this->assertEquals($result, $this->_block->getGridIdsJson());

app/code/Magento/Catalog/Block/Product/AbstractProduct.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class AbstractProduct extends \Magento\Framework\View\Element\Template
9696
*/
9797
protected $stockRegistry;
9898

99+
/**
100+
* @var ImageBuilder
101+
*/
102+
protected $imageBuilder;
103+
99104
/**
100105
* @param Context $context
101106
* @param array $data

app/code/Magento/Paypal/Model/Api/ProcessableException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ProcessableException extends LocalizedException
4040
*/
4141
public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0)
4242
{
43-
parent::__construct($phrase, $cause);
43+
parent::__construct($phrase, $cause, $code);
4444
$this->code = $code;
4545
}
4646

app/code/Magento/Search/Model/Synonym/MergeConflictException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ class MergeConflictException extends LocalizedException
2828
* @param array $conflictingSynonyms
2929
* @param Phrase|null $phrase
3030
* @param \Exception|null $cause
31+
* @param int $code
3132
*/
32-
public function __construct(array $conflictingSynonyms, Phrase $phrase = null, \Exception $cause = null)
33+
public function __construct(array $conflictingSynonyms, Phrase $phrase = null, \Exception $cause = null, $code = 0)
3334
{
34-
parent::__construct($phrase, $cause);
35+
parent::__construct($phrase, $cause, $code);
3536
$this->conflictingSynonyms = $conflictingSynonyms;
3637
}
3738

app/code/Magento/Store/Model/StoreIsInactiveException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ class StoreIsInactiveException extends LocalizedException
1616
/**
1717
* @param \Magento\Framework\Phrase $phrase
1818
* @param \Exception $cause
19+
* @param int $code
1920
*/
20-
public function __construct(Phrase $phrase = null, \Exception $cause = null)
21+
public function __construct(Phrase $phrase = null, \Exception $cause = null, $code = 0)
2122
{
2223
if ($phrase === null) {
2324
$phrase = new Phrase('Store is inactive');
2425
}
25-
parent::__construct($phrase, $cause);
26+
parent::__construct($phrase, $cause, $code);
2627
}
2728
}

lib/internal/Magento/Framework/App/ResourceConnection/Config.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ public function getConnectionName($resourceName)
6363
{
6464
$this->initConnections();
6565
$connectionName = \Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION;
66-
67-
$resourceName = preg_replace("/_setup$/", '', $resourceName);
68-
66+
6967
if (!isset($this->_connectionNames[$resourceName])) {
7068
$resourcesConfig = $this->get();
7169
$pointerResourceName = $resourceName;

lib/internal/Magento/Framework/Config/etc/view.xsd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
<xs:attribute name="value" type="xs:string"/>
3939
</xs:complexType>
4040
<xs:complexType name="mediaType" mixed="true">
41-
<xs:all>
42-
<xs:element name="images" type="imageType" minOccurs="0"/>
43-
<xs:element name="videos" type="videoType" minOccurs="0"/>
44-
</xs:all>
41+
<xs:sequence>
42+
<xs:element name="images" type="imageType" minOccurs="0" maxOccurs="unbounded"/>
43+
<xs:element name="videos" type="videoType" minOccurs="0" maxOccurs="unbounded"/>
44+
</xs:sequence>
4545
</xs:complexType>
4646

4747
<xs:complexType name="imageType">

0 commit comments

Comments
 (0)