Skip to content

Commit 4e80545

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-99312
2 parents b5eac9d + c20732c commit 4e80545

File tree

52 files changed

+779
-155
lines changed

Some content is hidden

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

52 files changed

+779
-155
lines changed

app/code/Magento/Catalog/Model/Product/Visibility.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(
5555
/**
5656
* Retrieve visible in catalog ids array
5757
*
58-
* @return string[]
58+
* @return int[]
5959
*/
6060
public function getVisibleInCatalogIds()
6161
{
@@ -65,7 +65,7 @@ public function getVisibleInCatalogIds()
6565
/**
6666
* Retrieve visible in search ids array
6767
*
68-
* @return string[]
68+
* @return int[]
6969
*/
7070
public function getVisibleInSearchIds()
7171
{
@@ -75,7 +75,7 @@ public function getVisibleInSearchIds()
7575
/**
7676
* Retrieve visible in site ids array
7777
*
78-
* @return string[]
78+
* @return int[]
7979
*/
8080
public function getVisibleInSiteIds()
8181
{
@@ -86,6 +86,7 @@ public function getVisibleInSiteIds()
8686
* Retrieve option array
8787
*
8888
* @return array
89+
* phpcs:disable Magento2.Functions.StaticFunction
8990
*/
9091
public static function getOptionArray()
9192
{
@@ -134,6 +135,7 @@ public static function getOptionText($optionId)
134135
$options = self::getOptionArray();
135136
return isset($options[$optionId]) ? $options[$optionId] : null;
136137
}
138+
//phpcs:enable Magento2.Functions.StaticFunction
137139

138140
/**
139141
* Retrieve flat column definition
@@ -251,7 +253,7 @@ public function addValueSortToCollection($collection, $dir = 'asc')
251253
}
252254

253255
/**
254-
* {@inheritdoc}
256+
* @inheritdoc
255257
*/
256258
public function toOptionArray()
257259
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
8080
<element name="sectionHeaderOpened" type="button" selector="[data-index='websites']._show" timeout="30"/>
8181
<element name="website" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox']" parameterized="true"/>
82+
<element name="websiteChecked" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox'][@value='1']" parameterized="true"/>
8283
</section>
8384
<section name="ProductDesignSection">
8485
<element name="DesignTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Design']"/>

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,9 @@ protected function getFieldsForFieldset()
175175
$label = __('Websites');
176176

177177
$defaultWebsiteId = $this->websiteRepository->getDefault()->getId();
178-
$isOnlyOneWebsiteAvailable = count($websitesList) === 1;
179178
foreach ($websitesList as $website) {
180179
$isChecked = in_array($website['id'], $websiteIds)
181-
|| ($defaultWebsiteId == $website['id'] && $isNewProduct)
182-
|| $isOnlyOneWebsiteAvailable;
180+
|| ($defaultWebsiteId == $website['id'] && $isNewProduct);
183181
$children[$website['id']] = [
184182
'arguments' => [
185183
'data' => [

app/code/Magento/CatalogSearch/Ui/DataProvider/Product/AddFulltextFilterToCollection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\CatalogSearch\Ui\DataProvider\Product;
77

8-
use Magento\Framework\Data\Collection;
98
use Magento\CatalogSearch\Model\ResourceModel\Search\Collection as SearchCollection;
9+
use Magento\Framework\Data\Collection;
1010
use Magento\Ui\DataProvider\AddFilterToCollectionInterface;
1111

1212
/**
@@ -30,14 +30,14 @@ public function __construct(SearchCollection $searchCollection)
3030
}
3131

3232
/**
33-
* {@inheritdoc}
33+
* @inheritdoc
3434
*
3535
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3636
*/
3737
public function addFilter(Collection $collection, $field, $condition = null)
3838
{
3939
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
40-
if (isset($condition['fulltext']) && !empty($condition['fulltext'])) {
40+
if (isset($condition['fulltext']) && (string)$condition['fulltext'] !== '') {
4141
$this->searchCollection->addBackendSearchFilter($condition['fulltext']);
4242
$productIds = $this->searchCollection->load()->getAllIds();
4343
$collection->addIdFilter($productIds);

app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@
123123
<rule name="required-entry" xsi:type="boolean">true</rule>
124124
</validation>
125125
<dataType>int</dataType>
126+
<tooltip>
127+
<link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link>
128+
<description>What is this?</description>
129+
</tooltip>
126130
<label translate="true">Store View</label>
127131
<dataScope>store_id</dataScope>
128132
</settings>

app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@
207207
<rule name="required-entry" xsi:type="boolean">true</rule>
208208
</validation>
209209
<dataType>int</dataType>
210+
<tooltip>
211+
<link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link>
212+
<description>What is this?</description>
213+
</tooltip>
210214
<label translate="true">Store View</label>
211215
<dataScope>store_id</dataScope>
212216
</settings>

app/code/Magento/ConfigurableProduct/Model/OptionRepository.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Magento\Store\Model\Store;
2323

2424
/**
25+
* Repository for performing CRUD operations for a configurable product's options.
2526
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2627
*/
2728
class OptionRepository implements \Magento\ConfigurableProduct\Api\OptionRepositoryInterface
@@ -112,7 +113,7 @@ public function __construct(
112113
}
113114

114115
/**
115-
* {@inheritdoc}
116+
* @inheritdoc
116117
*/
117118
public function get($sku, $id)
118119
{
@@ -131,7 +132,7 @@ public function get($sku, $id)
131132
}
132133

133134
/**
134-
* {@inheritdoc}
135+
* @inheritdoc
135136
*/
136137
public function getList($sku)
137138
{
@@ -141,7 +142,7 @@ public function getList($sku)
141142
}
142143

143144
/**
144-
* {@inheritdoc}
145+
* @inheritdoc
145146
*/
146147
public function delete(OptionInterface $option)
147148
{
@@ -167,7 +168,7 @@ public function delete(OptionInterface $option)
167168
}
168169

169170
/**
170-
* {@inheritdoc}
171+
* @inheritdoc
171172
*/
172173
public function deleteById($sku, $id)
173174
{
@@ -184,7 +185,7 @@ public function deleteById($sku, $id)
184185
}
185186

186187
/**
187-
* {@inheritdoc}
188+
* @inheritdoc
188189
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
189190
*/
190191
public function save($sku, OptionInterface $option)
@@ -213,6 +214,16 @@ public function save($sku, OptionInterface $option)
213214
throw new \InvalidArgumentException('Incompatible product type');
214215
}
215216
$option->setProductId($product->getData($metadata->getLinkField()));
217+
if (!empty($option->getProductId() && !empty($option->getAttributeId()))) {
218+
$id = $this->optionResource->getIdByProductIdAndAttributeId(
219+
$option,
220+
$option->getProductId(),
221+
$option->getAttributeId()
222+
);
223+
if (!empty($id)) {
224+
$option->setId($id);
225+
}
226+
}
216227
}
217228

218229
try {
@@ -296,6 +307,7 @@ public function validateNewOptionData(OptionInterface $option)
296307

297308
/**
298309
* Get MetadataPool instance
310+
*
299311
* @return MetadataPool
300312
*/
301313
private function getMetadataPool()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Customer\Model;
9+
10+
use Magento\Framework\App\RequestInterface;
11+
12+
/**
13+
* Provides customer id from request.
14+
*/
15+
class CustomerIdProvider
16+
{
17+
/**
18+
* @var RequestInterface
19+
*/
20+
private $request;
21+
22+
/**
23+
* @param RequestInterface $request
24+
*/
25+
public function __construct(
26+
RequestInterface $request
27+
) {
28+
$this->request = $request;
29+
}
30+
31+
/**
32+
* Get customer id from request.
33+
*
34+
* @return int
35+
*/
36+
public function getCustomerId(): int
37+
{
38+
return (int)$this->request->getParam('id');
39+
}
40+
}

app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
<referenceContainer name="content">
1616
<uiComponent name="customer_form"/>
1717
</referenceContainer>
18+
<referenceContainer name="after.body.start">
19+
<block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Configure" name="after.body.start.product_composite_configure" template="Magento_Catalog::catalog/product/composite/configure.phtml"/>
20+
</referenceContainer>
1821
</body>
1922
</page>

app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,12 @@
157157
<column name="billing_telephone" sortOrder="60">
158158
<settings>
159159
<filter>text</filter>
160-
<editor>
161-
<editorType>text</editorType>
162-
</editor>
163160
<label translate="true">Phone</label>
164161
</settings>
165162
</column>
166163
<column name="billing_postcode" sortOrder="70">
167164
<settings>
168165
<filter>text</filter>
169-
<editor>
170-
<editorType>text</editorType>
171-
</editor>
172166
<label translate="true">ZIP</label>
173167
</settings>
174168
</column>
@@ -269,59 +263,41 @@
269263
<column name="billing_city" sortOrder="210">
270264
<settings>
271265
<filter>text</filter>
272-
<editor>
273-
<editorType>text</editorType>
274-
</editor>
275266
<label translate="true">City</label>
276267
<visible>false</visible>
277268
</settings>
278269
</column>
279270
<column name="billing_fax" sortOrder="220">
280271
<settings>
281272
<filter>text</filter>
282-
<editor>
283-
<editorType>text</editorType>
284-
</editor>
285273
<label translate="true">Fax</label>
286274
<visible>false</visible>
287275
</settings>
288276
</column>
289277
<column name="billing_vat_id" sortOrder="230">
290278
<settings>
291279
<filter>text</filter>
292-
<editor>
293-
<editorType>text</editorType>
294-
</editor>
295280
<label translate="true">VAT Number</label>
296281
<visible>false</visible>
297282
</settings>
298283
</column>
299284
<column name="billing_company" sortOrder="240">
300285
<settings>
301286
<filter>text</filter>
302-
<editor>
303-
<editorType>text</editorType>
304-
</editor>
305287
<label translate="true">Company</label>
306288
<visible>false</visible>
307289
</settings>
308290
</column>
309291
<column name="billing_firstname" sortOrder="250">
310292
<settings>
311293
<filter>text</filter>
312-
<editor>
313-
<editorType>text</editorType>
314-
</editor>
315294
<label translate="true">Billing Firstname</label>
316295
<visible>false</visible>
317296
</settings>
318297
</column>
319298
<column name="billing_lastname" sortOrder="260">
320299
<settings>
321300
<filter>text</filter>
322-
<editor>
323-
<editorType>text</editorType>
324-
</editor>
325301
<label translate="true">Billing Lastname</label>
326302
<visible>false</visible>
327303
</settings>

0 commit comments

Comments
 (0)