Skip to content

Commit 5e3df2c

Browse files
merge magento/2.4.1-develop into magento-engcom/login-as-customer
2 parents f52921e + b246e2a commit 5e3df2c

File tree

103 files changed

+2017
-879
lines changed

Some content is hidden

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

103 files changed

+2017
-879
lines changed

app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@ private function getBillingAddressComponent($paymentCode, $elements)
351351
],
352352
],
353353
'telephone' => [
354-
'validation' => [
355-
'validate-phoneStrict' => 0,
356-
],
357354
'config' => [
358355
'tooltip' => [
359356
'description' => __('For delivery questions.'),

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutPhoneValidationTest.xml

Lines changed: 0 additions & 44 deletions
This file was deleted.

app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@
223223
</item>
224224
</item>
225225
<item name="telephone" xsi:type="array">
226-
<item name="validation" xsi:type="array">
227-
<item name="validate-phoneStrict" xsi:type="number">0</item>
228-
</item>
229226
<item name="config" xsi:type="array">
230227
<item name="tooltip" xsi:type="array">
231228
<item name="description" xsi:type="string" translate="true">For delivery questions.</item>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<item>Bld D</item>
2020
</array>
2121
<data key="company">Magento</data>
22-
<data key="telephone">123-456-7890</data>
22+
<data key="telephone">1234568910</data>
2323
<data key="fax">1234568910</data>
2424
<data key="postcode">78729</data>
2525
<data key="city">Austin</data>
@@ -172,7 +172,7 @@
172172
<data key="city">London</data>
173173
<data key="postcode">SE1 7RW</data>
174174
<data key="country_id">GB</data>
175-
<data key="telephone">444-444-4444</data>
175+
<data key="telephone">444-44-444-44</data>
176176
</entity>
177177
<entity name="US_Address_Utah" type="address">
178178
<data key="firstname">John</data>
@@ -227,7 +227,7 @@
227227
<data key="firstname">John</data>
228228
<data key="lastname">Doe</data>
229229
<data key="company">Magento</data>
230-
<data key="telephone">888-777-7890</data>
230+
<data key="telephone">0123456789-02134567</data>
231231
<array key="street">
232232
<item>172, Westminster Bridge Rd</item>
233233
<item>7700 xyz street</item>
@@ -305,7 +305,7 @@
305305
<data key="firstname">Jane</data>
306306
<data key="lastname">Miller</data>
307307
<data key="company">Magento</data>
308-
<data key="telephone">123-456-7899</data>
308+
<data key="telephone">44 20 7123 1234</data>
309309
<array key="street">
310310
<item>1 London Bridge Street</item>
311311
</array>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\MediaContentApi\Model;
10+
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
13+
/**
14+
* Class responsible to provide access to system configuration related to the Media Gallery
15+
*/
16+
class Config
17+
{
18+
/**
19+
* Path to enable/disable media gallery in the system settings.
20+
*/
21+
private const XML_PATH_ENABLED = 'system/media_gallery/enabled';
22+
23+
/**
24+
* @var ScopeConfigInterface
25+
*/
26+
private $scopeConfig;
27+
28+
/**
29+
* Config constructor.
30+
*
31+
* @param ScopeConfigInterface $scopeConfig
32+
*/
33+
public function __construct(ScopeConfigInterface $scopeConfig)
34+
{
35+
$this->scopeConfig = $scopeConfig;
36+
}
37+
38+
/**
39+
* Check if new media gallery enabled
40+
*
41+
* @return bool
42+
*/
43+
public function isEnabled(): bool
44+
{
45+
return $this->scopeConfig->isSetFlag(self::XML_PATH_ENABLED);
46+
}
47+
}

app/code/Magento/MediaContentCatalog/Observer/Category.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\MediaContentApi\Api\UpdateContentAssetLinksInterface;
1414
use Magento\MediaContentApi\Api\Data\ContentIdentityInterfaceFactory;
1515
use Magento\MediaContentApi\Model\GetEntityContentsInterface;
16+
use Magento\MediaContentApi\Model\Config;
1617

1718
/**
1819
* Observe the catalog_category_save_after event and run processing relation between category content and media asset.
@@ -29,6 +30,11 @@ class Category implements ObserverInterface
2930
*/
3031
private $updateContentAssetLinks;
3132

33+
/**
34+
* @var Config
35+
*/
36+
private $config;
37+
3238
/**
3339
* @var array
3440
*/
@@ -50,17 +56,20 @@ class Category implements ObserverInterface
5056
* @param ContentIdentityInterfaceFactory $contentIdentityFactory
5157
* @param GetEntityContentsInterface $getContent
5258
* @param UpdateContentAssetLinksInterface $updateContentAssetLinks
59+
* @param Config $config
5360
* @param array $fields
5461
*/
5562
public function __construct(
5663
ContentIdentityInterfaceFactory $contentIdentityFactory,
5764
GetEntityContentsInterface $getContent,
5865
UpdateContentAssetLinksInterface $updateContentAssetLinks,
66+
Config $config,
5967
array $fields
6068
) {
6169
$this->contentIdentityFactory = $contentIdentityFactory;
6270
$this->getContent = $getContent;
6371
$this->updateContentAssetLinks = $updateContentAssetLinks;
72+
$this->config = $config;
6473
$this->fields = $fields;
6574
}
6675

@@ -72,6 +81,10 @@ public function __construct(
7281
*/
7382
public function execute(Observer $observer): void
7483
{
84+
if (!$this->config->isEnabled()) {
85+
return;
86+
}
87+
7588
$model = $observer->getEvent()->getData('category');
7689

7790
if ($model instanceof CatalogCategory) {

app/code/Magento/MediaContentCatalog/Observer/CategoryDelete.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\MediaContentApi\Api\DeleteContentAssetLinksInterface;
1616
use Magento\MediaContentApi\Model\GetEntityContentsInterface;
1717
use Magento\MediaContentApi\Api\ExtractAssetsFromContentInterface;
18+
use Magento\MediaContentApi\Model\Config;
1819

1920
/**
2021
* Observe the catalog_category_delete_after event and deletes relation between category content and media asset.
@@ -25,7 +26,7 @@ class CategoryDelete implements ObserverInterface
2526
private const TYPE = 'entityType';
2627
private const ENTITY_ID = 'entityId';
2728
private const FIELD = 'field';
28-
29+
2930
/**
3031
* @var ContentIdentityInterfaceFactory
3132
*/
@@ -51,17 +52,23 @@ class CategoryDelete implements ObserverInterface
5152
*/
5253
private $getContent;
5354

55+
/**
56+
* @var Config
57+
*/
58+
private $config;
59+
5460
/**
5561
* @var ExtractAssetsFromContentInterface
5662
*/
5763
private $extractAssetsFromContent;
58-
64+
5965
/**
6066
* @param ExtractAssetsFromContentInterface $extractAssetsFromContent
6167
* @param GetEntityContentsInterface $getContent
6268
* @param DeleteContentAssetLinksInterface $deleteContentAssetLinks
6369
* @param ContentIdentityInterfaceFactory $contentIdentityFactory
6470
* @param ContentAssetLinkInterfaceFactory $contentAssetLinkFactory
71+
* @param Config $config
6572
* @param array $fields
6673
*/
6774
public function __construct(
@@ -70,10 +77,12 @@ public function __construct(
7077
DeleteContentAssetLinksInterface $deleteContentAssetLinks,
7178
ContentIdentityInterfaceFactory $contentIdentityFactory,
7279
ContentAssetLinkInterfaceFactory $contentAssetLinkFactory,
80+
Config $config,
7381
array $fields
7482
) {
7583
$this->extractAssetsFromContent = $extractAssetsFromContent;
7684
$this->getContent = $getContent;
85+
$this->config = $config;
7786
$this->deleteContentAssetLinks = $deleteContentAssetLinks;
7887
$this->contentAssetLinkFactory = $contentAssetLinkFactory;
7988
$this->contentIdentityFactory = $contentIdentityFactory;
@@ -88,9 +97,13 @@ public function __construct(
8897
*/
8998
public function execute(Observer $observer): void
9099
{
100+
if (!$this->config->isEnabled()) {
101+
return;
102+
}
103+
91104
$category = $observer->getEvent()->getData('category');
92105
$contentAssetLinks = [];
93-
106+
94107
if ($category instanceof CatalogCategory) {
95108
foreach ($this->fields as $field) {
96109
$contentIdentity = $this->contentIdentityFactory->create(

app/code/Magento/MediaContentCatalog/Observer/Product.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\MediaContentApi\Api\UpdateContentAssetLinksInterface;
1414
use Magento\MediaContentApi\Api\Data\ContentIdentityInterfaceFactory;
1515
use Magento\MediaContentApi\Model\GetEntityContentsInterface;
16+
use Magento\MediaContentApi\Model\Config;
1617

1718
/**
1819
* Observe the catalog_product_save_after event and run processing relation between product content and media asset
@@ -34,6 +35,11 @@ class Product implements ObserverInterface
3435
*/
3536
private $fields;
3637

38+
/**
39+
* @var Config
40+
*/
41+
private $config;
42+
3743
/**
3844
* @var ContentIdentityInterfaceFactory
3945
*/
@@ -45,22 +51,25 @@ class Product implements ObserverInterface
4551
private $getContent;
4652

4753
/**
48-
* * Create links for product content
54+
* Product observer constructor
4955
*
5056
* @param ContentIdentityInterfaceFactory $contentIdentityFactory
5157
* @param GetEntityContentsInterface $getContent
5258
* @param UpdateContentAssetLinksInterface $updateContentAssetLinks
59+
* @param Config $config
5360
* @param array $fields
5461
*/
5562
public function __construct(
5663
ContentIdentityInterfaceFactory $contentIdentityFactory,
5764
GetEntityContentsInterface $getContent,
5865
UpdateContentAssetLinksInterface $updateContentAssetLinks,
66+
Config $config,
5967
array $fields
6068
) {
6169
$this->contentIdentityFactory = $contentIdentityFactory;
6270
$this->getContent = $getContent;
6371
$this->updateContentAssetLinks = $updateContentAssetLinks;
72+
$this->config = $config;
6473
$this->fields = $fields;
6574
}
6675

@@ -72,6 +81,10 @@ public function __construct(
7281
*/
7382
public function execute(Observer $observer): void
7483
{
84+
if (!$this->config->isEnabled()) {
85+
return;
86+
}
87+
7588
$model = $observer->getEvent()->getData('product');
7689
if ($model instanceof CatalogProduct) {
7790
foreach ($this->fields as $field) {

0 commit comments

Comments
 (0)