Skip to content

Commit 02feb0b

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into 2.3.0-release-sync
2 parents d26ad1e + a474225 commit 02feb0b

File tree

299 files changed

+7033
-1110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+7033
-1110
lines changed

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,8 @@ Magento is thankful for any contribution that can improve our code base, documen
4141
</a>
4242

4343
<h3>Labels applied by the Magento team</h3>
44-
45-
| Label | Description |
46-
| ------------- |-------------|
47-
| ![DOC](http://devdocs.magento.com/common/images/github_DOC.png) | Affects Documentation domain. |
48-
| ![PROD](http://devdocs.magento.com/common/images/github_PROD.png) | Affects the Product team (mostly feature requests or business logic change). |
49-
| ![TECH](http://devdocs.magento.com/common/images/github_TECH.png) | Affects Architect Group (mostly to make decisions around technology changes). |
50-
| ![accept](http://devdocs.magento.com/common/images/github_accept.png) | The pull request has been accepted and will be merged into mainline code. |
51-
| ![reject](http://devdocs.magento.com/common/images/github_reject.png) | The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution. |
52-
| ![bug report](http://devdocs.magento.com/common/images/github_bug.png) | The Magento Team has confirmed that this issue contains the minimum required information to reproduce. |
53-
| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. |
54-
| ![in progress](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
55-
| ![needs update](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
56-
57-
To learn more about issue gate labels click [here](https://github.com/magento/magento2/wiki/Magento-Issue-Gates)
44+
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
45+
Please review the <a href="https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels">Code Contributions guide</a> for detailed information on labels used in Magento 2 repositories.
5846

5947
<h2>Reporting security issues</h2>
6048

app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
/**
1313
* Responsible for Select object creation, works as a builder. Returns Select as result;
14+
*
1415
* Used in SQL assemblers.
1516
*/
1617
class SelectBuilder
@@ -85,11 +86,13 @@ public function getJoins()
8586
* Set joins conditions
8687
*
8788
* @param array $joins
88-
* @return void
89+
* @return $this
8990
*/
9091
public function setJoins($joins)
9192
{
9293
$this->joins = $joins;
94+
95+
return $this;
9396
}
9497

9598
/**
@@ -106,11 +109,13 @@ public function getConnectionName()
106109
* Set connection name
107110
*
108111
* @param string $connectionName
109-
* @return void
112+
* @return $this
110113
*/
111114
public function setConnectionName($connectionName)
112115
{
113116
$this->connectionName = $connectionName;
117+
118+
return $this;
114119
}
115120

116121
/**
@@ -127,11 +132,13 @@ public function getColumns()
127132
* Set columns
128133
*
129134
* @param array $columns
130-
* @return void
135+
* @return $this
131136
*/
132137
public function setColumns($columns)
133138
{
134139
$this->columns = $columns;
140+
141+
return $this;
135142
}
136143

137144
/**
@@ -148,11 +155,13 @@ public function getFilters()
148155
* Set filters
149156
*
150157
* @param array $filters
151-
* @return void
158+
* @return $this
152159
*/
153160
public function setFilters($filters)
154161
{
155162
$this->filters = $filters;
163+
164+
return $this;
156165
}
157166

158167
/**
@@ -169,11 +178,13 @@ public function getFrom()
169178
* Set from condition
170179
*
171180
* @param array $from
172-
* @return void
181+
* @return $this
173182
*/
174183
public function setFrom($from)
175184
{
176185
$this->from = $from;
186+
187+
return $this;
177188
}
178189

179190
/**
@@ -236,11 +247,13 @@ public function getGroup()
236247
* Set group
237248
*
238249
* @param array $group
239-
* @return void
250+
* @return $this
240251
*/
241252
public function setGroup($group)
242253
{
243254
$this->group = $group;
255+
256+
return $this;
244257
}
245258

246259
/**
@@ -257,11 +270,13 @@ public function getParams()
257270
* Set parameters
258271
*
259272
* @param array $params
260-
* @return void
273+
* @return $this
261274
*/
262275
public function setParams($params)
263276
{
264277
$this->params = $params;
278+
279+
return $this;
265280
}
266281

267282
/**
@@ -278,10 +293,12 @@ public function getHaving()
278293
* Set having condition
279294
*
280295
* @param array $having
281-
* @return void
296+
* @return $this
282297
*/
283298
public function setHaving($having)
284299
{
285300
$this->having = $having;
301+
302+
return $this;
286303
}
287304
}

app/code/Magento/Analytics/Test/Unit/ReportXml/DB/SelectBuilderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public function testCreate()
6464
['link-type' => 'right', 'table' => 'attribute', 'condition' => 'neq'],
6565
];
6666
$groups = ['id', 'name'];
67-
$this->selectBuilder->setConnectionName($connectionName);
68-
$this->selectBuilder->setFrom($from);
69-
$this->selectBuilder->setColumns($columns);
70-
$this->selectBuilder->setFilters([$filter]);
71-
$this->selectBuilder->setJoins($joins);
72-
$this->selectBuilder->setGroup($groups);
67+
$this->selectBuilder->setConnectionName($connectionName)
68+
->setFrom($from)
69+
->setColumns($columns)
70+
->setFilters([$filter])
71+
->setJoins($joins)
72+
->setGroup($groups);
7373
$this->resourceConnectionMock->expects($this->once())
7474
->method('getConnection')
7575
->with($connectionName)

app/code/Magento/Backend/Block/Widget/Button/ButtonList.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
namespace Magento\Backend\Block\Widget\Button;
88

99
/**
10+
* Button list widget
11+
*
1012
* @api
1113
* @since 100.0.2
1214
*/
@@ -127,12 +129,6 @@ public function getItems()
127129
*/
128130
public function sortButtons(Item $itemA, Item $itemB)
129131
{
130-
$sortOrderA = (int) $itemA->getSortOrder();
131-
$sortOrderB = (int) $itemB->getSortOrder();
132-
133-
if ($sortOrderA == $sortOrderB) {
134-
return 0;
135-
}
136-
return ($sortOrderA < $sortOrderB) ? -1 : 1;
132+
return (int)$itemA->getSortOrder() <=> (int)$itemB->getSortOrder();
137133
}
138134
}

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
data-validate="{required:true}"
4444
value=""
4545
placeholder="<?= /* @escapeNotVerified */ __('password') ?>"
46-
autocomplete="new-password"
46+
autocomplete="off"
4747
/>
4848
</div>
4949
</div>

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ public function getJsonConfig()
188188
$configValue = $preConfiguredValues->getData('bundle_option/' . $optionId);
189189
if ($configValue) {
190190
$defaultValues[$optionId] = $configValue;
191+
$configQty = $preConfiguredValues->getData('bundle_option_qty/' . $optionId);
192+
if ($configQty) {
193+
$options[$optionId]['selections'][$configValue]['qty'] = $configQty;
194+
}
191195
}
192196
}
193197
$position++;

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
namespace Magento\Bundle\Model\Product;
88

9-
use Magento\Framework\App\ObjectManager;
9+
use Magento\Bundle\Model\ResourceModel\Selection\Collection as Selections;
10+
use Magento\Bundle\Model\ResourceModel\Selection\Collection\FilterApplier as SelectionCollectionFilterApplier;
1011
use Magento\Catalog\Api\ProductRepositoryInterface;
12+
use Magento\Framework\App\ObjectManager;
13+
use Magento\Framework\EntityManager\MetadataPool;
1114
use Magento\Framework\Pricing\PriceCurrencyInterface;
1215
use Magento\Framework\Serialize\Serializer\Json;
13-
use Magento\Framework\EntityManager\MetadataPool;
14-
use Magento\Bundle\Model\ResourceModel\Selection\Collection\FilterApplier as SelectionCollectionFilterApplier;
15-
use Magento\Bundle\Model\ResourceModel\Selection\Collection as Selections;
1616

1717
/**
1818
* Bundle Type Model
@@ -537,7 +537,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
537537
foreach ($options as $quoteItemOption) {
538538
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
539539
if ($optionUpdateFlag) {
540-
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
540+
$quoteItemOption->setValue((int) $quoteItemOption->getValue());
541541
} else {
542542
$quoteItemOption->setValue($value);
543543
}
@@ -625,6 +625,7 @@ public function isSalable($product)
625625

626626
/**
627627
* Prepare product and its configuration to be added to some products list.
628+
*
628629
* Perform standard preparation process and then prepare of bundle selections options.
629630
*
630631
* @param \Magento\Framework\DataObject $buyRequest
@@ -790,6 +791,8 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
790791
}
791792

792793
/**
794+
* Cast array values to int
795+
*
793796
* @param array $array
794797
* @return int[]|int[][]
795798
*/
@@ -809,6 +812,8 @@ private function recursiveIntval(array $array)
809812
}
810813

811814
/**
815+
* Convert multi dimensional array to flat
816+
*
812817
* @param array $array
813818
* @return int[]
814819
*/
@@ -920,8 +925,7 @@ public function getOptionsByIds($optionIds, $product)
920925
}
921926

922927
/**
923-
* Prepare additional options/information for order item which will be
924-
* created from this product
928+
* Prepare additional options/information for order item which will be created from this product
925929
*
926930
* @param \Magento\Catalog\Model\Product $product
927931
* @return array
@@ -987,6 +991,7 @@ public function getOrderOptions($product)
987991

988992
/**
989993
* Sort selections method for usort function
994+
*
990995
* Sort selections by option position, selection position and selection id
991996
*
992997
* @param \Magento\Catalog\Model\Product $firstItem
@@ -1009,10 +1014,8 @@ public function shakeSelections($firstItem, $secondItem)
10091014
$secondItem->getPosition(),
10101015
$secondItem->getSelectionId(),
10111016
];
1012-
if ($aPosition == $bPosition) {
1013-
return 0;
1014-
}
1015-
return $aPosition < $bPosition ? -1 : 1;
1017+
1018+
return $aPosition <=> $bPosition;
10161019
}
10171020

10181021
/**
@@ -1050,6 +1053,7 @@ public function getForceChildItemQtyChanges($product)
10501053

10511054
/**
10521055
* Retrieve additional searchable data from type instance
1056+
*
10531057
* Using based on product id and store_id data
10541058
*
10551059
* @param \Magento\Catalog\Model\Product $product
@@ -1118,6 +1122,7 @@ public function checkProductBuyState($product)
11181122

11191123
/**
11201124
* Retrieve products divided into groups required to purchase
1125+
*
11211126
* At least one product in each group has to be purchased
11221127
*
11231128
* @param \Magento\Catalog\Model\Product $product
@@ -1214,6 +1219,8 @@ public function getIdentities(\Magento\Catalog\Model\Product $product)
12141219
}
12151220

12161221
/**
1222+
* Returns selection qty
1223+
*
12171224
* @param \Magento\Framework\DataObject $selection
12181225
* @param int[] $qtys
12191226
* @param int $selectionOptionId
@@ -1232,6 +1239,8 @@ protected function getQty($selection, $qtys, $selectionOptionId)
12321239
}
12331240

12341241
/**
1242+
* Returns qty
1243+
*
12351244
* @param \Magento\Catalog\Model\Product $product
12361245
* @param \Magento\Framework\DataObject $selection
12371246
* @return float|int
@@ -1249,6 +1258,8 @@ protected function getBeforeQty($product, $selection)
12491258
}
12501259

12511260
/**
1261+
* Validate required options
1262+
*
12521263
* @param \Magento\Catalog\Model\Product $product
12531264
* @param bool $isStrictProcessMode
12541265
* @param \Magento\Bundle\Model\ResourceModel\Option\Collection $optionsCollection
@@ -1270,6 +1281,8 @@ protected function checkIsAllRequiredOptions($product, $isStrictProcessMode, $op
12701281
}
12711282

12721283
/**
1284+
* Check if selection is salable
1285+
*
12731286
* @param \Magento\Bundle\Model\ResourceModel\Selection\Collection $selections
12741287
* @param bool $skipSaleableCheck
12751288
* @param \Magento\Bundle\Model\ResourceModel\Option\Collection $optionsCollection
@@ -1300,6 +1313,8 @@ protected function checkSelectionsIsSale($selections, $skipSaleableCheck, $optio
13001313
}
13011314

13021315
/**
1316+
* Validate result
1317+
*
13031318
* @param array $_result
13041319
* @return void
13051320
* @throws \Magento\Framework\Exception\LocalizedException
@@ -1318,6 +1333,8 @@ protected function checkIsResult($_result)
13181333
}
13191334

13201335
/**
1336+
* Merge selections with options
1337+
*
13211338
* @param \Magento\Catalog\Model\Product\Option[] $options
13221339
* @param \Magento\Framework\DataObject[] $selections
13231340
* @return \Magento\Framework\DataObject[]

0 commit comments

Comments
 (0)