Skip to content

Commit df3360b

Browse files
author
Valeriy Nayda
committed
Merge remote-tracking branch 'origin/2.3-develop' into product-url-rewrites
2 parents 16b72a8 + 8460e4e commit df3360b

File tree

60 files changed

+855
-295
lines changed

Some content is hidden

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

60 files changed

+855
-295
lines changed

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

+25-8
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

+6-6
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/view/adminhtml/templates/admin/login.phtml

+1-1
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/etc/db_schema.xml

+19-19
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@
120120
<table name="catalog_product_bundle_price_index" resource="default" engine="innodb"
121121
comment="Catalog Product Bundle Price Index">
122122
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
123-
comment="Entity Id"/>
123+
comment="Entity ID"/>
124124
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
125125
comment="Website Id"/>
126126
<column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="false"
127-
comment="Customer Group Id"/>
127+
comment="Customer Group ID"/>
128128
<column xsi:type="decimal" name="min_price" scale="4" precision="12" unsigned="false" nullable="false"
129129
comment="Min Price"/>
130130
<column xsi:type="decimal" name="max_price" scale="4" precision="12" unsigned="false" nullable="false"
@@ -153,11 +153,11 @@
153153
<table name="catalog_product_bundle_stock_index" resource="default" engine="innodb"
154154
comment="Catalog Product Bundle Stock Index">
155155
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
156-
comment="Entity Id"/>
156+
comment="Entity ID"/>
157157
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
158-
comment="Website Id"/>
158+
comment="Website ID"/>
159159
<column xsi:type="smallint" name="stock_id" padding="5" unsigned="true" nullable="false" identity="false"
160-
comment="Stock Id"/>
160+
comment="Stock ID"/>
161161
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="false"
162162
default="0" comment="Option Id"/>
163163
<column xsi:type="smallint" name="stock_status" padding="6" unsigned="false" nullable="true" identity="false"
@@ -172,13 +172,13 @@
172172
<table name="catalog_product_index_price_bundle_idx" resource="default" engine="innodb"
173173
comment="Catalog Product Index Price Bundle Idx">
174174
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
175-
comment="Entity Id"/>
175+
comment="Entity ID"/>
176176
<column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="false"
177177
identity="false"/>
178178
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
179-
comment="Website Id"/>
179+
comment="Website ID"/>
180180
<column xsi:type="smallint" name="tax_class_id" padding="5" unsigned="true" nullable="true" identity="false"
181-
default="0" comment="Tax Class Id"/>
181+
default="0" comment="Tax Class ID"/>
182182
<column xsi:type="smallint" name="price_type" padding="5" unsigned="true" nullable="false" identity="false"
183183
comment="Price Type"/>
184184
<column xsi:type="decimal" name="special_price" scale="4" precision="12" unsigned="false" nullable="true"
@@ -206,13 +206,13 @@
206206
<table name="catalog_product_index_price_bundle_tmp" resource="default" engine="memory"
207207
comment="Catalog Product Index Price Bundle Tmp">
208208
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
209-
comment="Entity Id"/>
209+
comment="Entity ID"/>
210210
<column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="false"
211211
identity="false"/>
212212
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
213-
comment="Website Id"/>
213+
comment="Website ID"/>
214214
<column xsi:type="smallint" name="tax_class_id" padding="5" unsigned="true" nullable="true" identity="false"
215-
default="0" comment="Tax Class Id"/>
215+
default="0" comment="Tax Class ID"/>
216216
<column xsi:type="smallint" name="price_type" padding="5" unsigned="true" nullable="false" identity="false"
217217
comment="Price Type"/>
218218
<column xsi:type="decimal" name="special_price" scale="4" precision="12" unsigned="false" nullable="true"
@@ -240,11 +240,11 @@
240240
<table name="catalog_product_index_price_bundle_sel_idx" resource="default" engine="innodb"
241241
comment="Catalog Product Index Price Bundle Sel Idx">
242242
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
243-
comment="Entity Id"/>
243+
comment="Entity ID"/>
244244
<column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="false"
245245
identity="false"/>
246246
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
247-
comment="Website Id"/>
247+
comment="Website ID"/>
248248
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="false"
249249
default="0" comment="Option Id"/>
250250
<column xsi:type="int" name="selection_id" padding="10" unsigned="true" nullable="false" identity="false"
@@ -268,11 +268,11 @@
268268
<table name="catalog_product_index_price_bundle_sel_tmp" resource="default" engine="memory"
269269
comment="Catalog Product Index Price Bundle Sel Tmp">
270270
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
271-
comment="Entity Id"/>
271+
comment="Entity ID"/>
272272
<column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="false"
273273
identity="false"/>
274274
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
275-
comment="Website Id"/>
275+
comment="Website ID"/>
276276
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="false"
277277
default="0" comment="Option Id"/>
278278
<column xsi:type="int" name="selection_id" padding="10" unsigned="true" nullable="false" identity="false"
@@ -296,11 +296,11 @@
296296
<table name="catalog_product_index_price_bundle_opt_idx" resource="default" engine="innodb"
297297
comment="Catalog Product Index Price Bundle Opt Idx">
298298
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
299-
comment="Entity Id"/>
299+
comment="Entity ID"/>
300300
<column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="false"
301301
identity="false"/>
302302
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
303-
comment="Website Id"/>
303+
comment="Website ID"/>
304304
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="false"
305305
default="0" comment="Option Id"/>
306306
<column xsi:type="decimal" name="min_price" scale="4" precision="12" unsigned="false" nullable="true"
@@ -323,11 +323,11 @@
323323
<table name="catalog_product_index_price_bundle_opt_tmp" resource="default" engine="memory"
324324
comment="Catalog Product Index Price Bundle Opt Tmp">
325325
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
326-
comment="Entity Id"/>
326+
comment="Entity ID"/>
327327
<column xsi:type="int" name="customer_group_id" padding="11" unsigned="false" nullable="false"
328328
identity="false"/>
329329
<column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
330-
comment="Website Id"/>
330+
comment="Website ID"/>
331331
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="false"
332332
default="0" comment="Option Id"/>
333333
<column xsi:type="decimal" name="min_price" scale="4" precision="12" unsigned="false" nullable="true"

app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
class UpdateHandler extends \Magento\Catalog\Model\Product\Gallery\CreateHandler
1717
{
1818
/**
19-
* {@inheritdoc}
19+
* @inheritdoc
20+
*
2021
* @since 101.0.0
2122
*/
2223
protected function processDeletedImages($product, array &$images)
@@ -31,7 +32,7 @@ protected function processDeletedImages($product, array &$images)
3132

3233
foreach ($images as &$image) {
3334
if (!empty($image['removed'])) {
34-
if (!empty($image['value_id']) && !isset($picturesInOtherStores[$image['file']])) {
35+
if (!empty($image['value_id'])) {
3536
if (preg_match('/\.\.(\\\|\/)/', $image['file'])) {
3637
continue;
3738
}
@@ -52,7 +53,8 @@ protected function processDeletedImages($product, array &$images)
5253
}
5354

5455
/**
55-
* {@inheritdoc}
56+
* @inheritdoc
57+
*
5658
* @since 101.0.0
5759
*/
5860
protected function processNewImage($product, array &$image)
@@ -79,6 +81,8 @@ protected function processNewImage($product, array &$image)
7981
}
8082

8183
/**
84+
* Retrieve store ids from product.
85+
*
8286
* @param \Magento\Catalog\Model\Product $product
8387
* @return array
8488
* @since 101.0.0
@@ -97,6 +101,8 @@ protected function extractStoreIds($product)
97101
}
98102

99103
/**
104+
* Remove deleted images.
105+
*
100106
* @param array $files
101107
* @return null
102108
* @since 101.0.0

app/code/Magento/Catalog/Model/ProductLink/CollectionProvider.php

+13-12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Catalog\Model\ProductLink\Converter\ConverterPool;
1010
use Magento\Framework\Exception\NoSuchEntityException;
1111

12+
/**
13+
* Provides a collection of linked product items (crosssells, related, upsells, ...)
14+
*/
1215
class CollectionProvider
1316
{
1417
/**
@@ -47,22 +50,20 @@ public function getCollection(\Magento\Catalog\Model\Product $product, $type)
4750

4851
$products = $this->providers[$type]->getLinkedProducts($product);
4952
$converter = $this->converterPool->getConverter($type);
50-
$output = [];
5153
$sorterItems = [];
5254
foreach ($products as $item) {
53-
$output[$item->getId()] = $converter->convert($item);
55+
$itemId = $item->getId();
56+
$sorterItems[$itemId] = $converter->convert($item);
57+
$sorterItems[$itemId]['position'] = $sorterItems[$itemId]['position'] ?? 0;
5458
}
5559

56-
foreach ($output as $item) {
57-
$itemPosition = $item['position'];
58-
if (!isset($sorterItems[$itemPosition])) {
59-
$sorterItems[$itemPosition] = $item;
60-
} else {
61-
$newPosition = $itemPosition + 1;
62-
$sorterItems[$newPosition] = $item;
63-
}
64-
}
65-
ksort($sorterItems);
60+
usort($sorterItems, function ($itemA, $itemB) {
61+
$posA = intval($itemA['position']);
62+
$posB = intval($itemB['position']);
63+
64+
return $posA <=> $posB;
65+
});
66+
6667
return $sorterItems;
6768
}
6869
}

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductContentSection.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="descriptionTextArea" type="textarea" selector="#product_form_description"/>
1414
<element name="shortDescriptionTextArea" type="textarea" selector="#product_form_short_description"/>
1515
<element name="sectionHeaderIfNotShowing" type="button" selector="//div[@data-index='content']//div[contains(@class, '_hide')]"/>
16+
<element name="pageHeader" type="textarea" selector="//*[@class='page-header row']"/>
1617
</section>
1718
</sections>

0 commit comments

Comments
 (0)