Skip to content

Commit 1693019

Browse files
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into batch-35-forwardport-2.3-develop
2 parents bd07bcc + 87e96d3 commit 1693019

File tree

1,176 files changed

+22207
-10164
lines changed

Some content is hidden

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

1,176 files changed

+22207
-10164
lines changed

.php_cs.dist

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
/**
8-
* Pre-commit hook installation:
9-
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
8+
* PHP Coding Standards fixer configuration
109
*/
10+
1111
$finder = PhpCsFixer\Finder::create()
1212
->name('*.phtml')
1313
->exclude('dev/tests/functional/generated')

app/code/Magento/AdminNotification/etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_AdminNotification" setup_version="2.0.0">
9+
<module name="Magento_AdminNotification" >
1010
<sequence>
1111
<module name="Magento_Store"/>
1212
</sequence>

app/code/Magento/AdvancedPricingImportExport/etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_AdvancedPricingImportExport" setup_version="2.0.0">
9+
<module name="Magento_AdvancedPricingImportExport" >
1010
</module>
1111
</config>

app/code/Magento/Analytics/Model/Config/Backend/CollectionTime.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function afterSave()
6666
$result = preg_match('#(?<hour>\d{2}),(?<min>\d{2}),(?<sec>\d{2})#', $this->getValue(), $time);
6767

6868
if (!$result) {
69-
throw new LocalizedException(__('Time value has an unsupported format'));
69+
throw new LocalizedException(
70+
__('The time value is using an unsupported format. Enter a supported format and try again.')
71+
);
7072
}
7173

7274
$cronExprArray = [

app/code/Magento/Analytics/Model/Cryptographer.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,18 @@ public function encode($source)
5656
try {
5757
$source = (string)$source;
5858
} catch (\Exception $e) {
59-
throw new LocalizedException(__('Input data must be string or convertible into string.'));
59+
throw new LocalizedException(
60+
__(
61+
'The data is invalid. '
62+
. 'Enter the data as a string or data that can be converted into a string and try again.'
63+
)
64+
);
6065
}
6166
} elseif (!$source) {
62-
throw new LocalizedException(__('Input data must be non-empty string.'));
67+
throw new LocalizedException(__('The data is invalid. Enter the data as a string and try again.'));
6368
}
6469
if (!$this->validateCipherMethod($this->cipherMethod)) {
65-
throw new LocalizedException(__('Not valid cipher method.'));
70+
throw new LocalizedException(__('The data is invalid. Use a valid cipher method and try again.'));
6671
}
6772
$initializationVector = $this->getInitializationVector();
6873

@@ -90,7 +95,7 @@ private function getKey()
9095
{
9196
$token = $this->analyticsToken->getToken();
9297
if (!$token) {
93-
throw new LocalizedException(__('Encryption key can\'t be empty.'));
98+
throw new LocalizedException(__('Enter the encryption key and try again.'));
9499
}
95100
return hash('sha256', $token);
96101
}

app/code/Magento/Analytics/Model/ExportDataHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function pack($source, $destination)
195195
private function validateSource(WriteInterface $directory, $path)
196196
{
197197
if (!$directory->isExist($path)) {
198-
throw new LocalizedException(__('Source "%1" is not exist', $directory->getAbsolutePath($path)));
198+
throw new LocalizedException(__('The "%1" source doesn\'t exist.', $directory->getAbsolutePath($path)));
199199
}
200200

201201
return $directory->getAbsolutePath($path);

app/code/Magento/Analytics/Setup/InstallData.php

-52
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Analytics\Setup\Patch\Data;
8+
9+
use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler;
10+
use Magento\Framework\App\ResourceConnection;
11+
use Magento\Framework\Setup\ModuleDataSetupInterface;
12+
use Magento\Setup\Model\Patch\DataPatchInterface;
13+
use Magento\Setup\Model\Patch\PatchVersionInterface;
14+
15+
/**
16+
* Initial patch.
17+
*
18+
* @package Magento\Analytics\Setup\Patch
19+
*/
20+
class PrepareInitialConfig implements DataPatchInterface, PatchVersionInterface
21+
{
22+
/**
23+
* @var ModuleDataSetupInterface
24+
*/
25+
private $moduleDataSetup;
26+
27+
/**
28+
* PrepareInitialConfig constructor.
29+
* @param ModuleDataSetupInterface $moduleDataSetup
30+
*/
31+
public function __construct(
32+
ModuleDataSetupInterface $moduleDataSetup
33+
) {
34+
$this->moduleDataSetup = $moduleDataSetup;
35+
}
36+
37+
/**
38+
* {@inheritdoc}
39+
*/
40+
public function apply()
41+
{
42+
$this->moduleDataSetup->getConnection()->insertMultiple(
43+
$this->moduleDataSetup->getTable('core_config_data'),
44+
[
45+
[
46+
'scope' => 'default',
47+
'scope_id' => 0,
48+
'path' => 'analytics/subscription/enabled',
49+
'value' => 1
50+
],
51+
[
52+
'scope' => 'default',
53+
'scope_id' => 0,
54+
'path' => SubscriptionHandler::CRON_STRING_PATH,
55+
'value' => join(' ', SubscriptionHandler::CRON_EXPR_ARRAY)
56+
]
57+
]
58+
);
59+
60+
$this->moduleDataSetup->getConnection()->insert(
61+
$this->moduleDataSetup->getTable('flag'),
62+
[
63+
'flag_code' => SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE,
64+
'state' => 0,
65+
'flag_data' => 24,
66+
]
67+
);
68+
}
69+
70+
/**
71+
* {@inheritdoc}
72+
*/
73+
public static function getDependencies()
74+
{
75+
return [];
76+
}
77+
78+
/**
79+
* {@inheritdoc}
80+
*/
81+
public static function getVersion()
82+
{
83+
return '2.0.0';
84+
}
85+
86+
/**
87+
* {@inheritdoc}
88+
*/
89+
public function getAliases()
90+
{
91+
return [];
92+
}
93+
}

app/code/Magento/Analytics/etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Analytics" setup_version="2.0.0">
9+
<module name="Magento_Analytics" >
1010
<sequence>
1111
<module name="Magento_Integration"/>
1212
<module name="Magento_Backend"/>

app/code/Magento/Authorization/Model/Acl/AclRetriever.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getAllowedResourcesByUser($userType, $userId)
8484
$role = $this->_getUserRole($userType, $userId);
8585
if (!$role) {
8686
throw new AuthorizationException(
87-
__('We can\'t find the role for the user you wanted.')
87+
__("The role wasn't found for the user. Verify the role and try again.")
8888
);
8989
}
9090
$allowedResources = $this->getAllowedResourcesByRole($role->getId());

app/code/Magento/Authorization/Setup/InstallData.php app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php

+52-20
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,48 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Authorization\Setup;
7+
namespace Magento\Authorization\Setup\Patch\Data;
88

9-
use Magento\Framework\Setup\InstallDataInterface;
10-
use Magento\Framework\Setup\ModuleContextInterface;
9+
use Magento\Framework\App\ResourceConnection;
1110
use Magento\Framework\Setup\ModuleDataSetupInterface;
11+
use Magento\Setup\Model\Patch\DataPatchInterface;
12+
use Magento\Setup\Model\Patch\PatchVersionInterface;
1213
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
1314
use Magento\Authorization\Model\UserContextInterface;
1415

1516
/**
16-
* @codeCoverageIgnore
17+
* Class InitializeAuthRoles
18+
* @package Magento\Authorization\Setup\Patch
1719
*/
18-
class InstallData implements InstallDataInterface
20+
class InitializeAuthRoles implements DataPatchInterface, PatchVersionInterface
1921
{
2022
/**
21-
* Authorization factory
22-
*
23-
* @var AuthorizationFactory
23+
* @var ModuleDataSetupInterface
24+
*/
25+
private $moduleDataSetup;
26+
27+
/**
28+
* @var \Magento\Authorization\Setup\AuthorizationFactory
2429
*/
2530
private $authFactory;
2631

2732
/**
28-
* Init
29-
*
30-
* @param AuthorizationFactory $authFactory
33+
* InitializeAuthRoles constructor.
34+
* @param ModuleDataSetupInterface $moduleDataSetup
35+
* @param \Magento\Authorization\Setup\AuthorizationFactory $authorizationFactory
3136
*/
32-
public function __construct(AuthorizationFactory $authFactory)
33-
{
34-
$this->authFactory = $authFactory;
37+
public function __construct(
38+
ModuleDataSetupInterface $moduleDataSetup,
39+
\Magento\Authorization\Setup\AuthorizationFactory $authorizationFactory
40+
) {
41+
$this->moduleDataSetup = $moduleDataSetup;
42+
$this->authFactory = $authorizationFactory;
3543
}
3644

3745
/**
3846
* {@inheritdoc}
3947
*/
40-
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
48+
public function apply()
4149
{
4250
$roleCollection = $this->authFactory->createRoleCollection()
4351
->addFieldToFilter('parent_id', 0)
@@ -60,6 +68,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
6068
]
6169
)->save();
6270
} else {
71+
/** @var \Magento\Authorization\Model\ResourceModel\Role $item */
6372
foreach ($roleCollection as $item) {
6473
$admGroupRole = $item;
6574
break;
@@ -89,13 +98,36 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
8998
/**
9099
* Delete rows by condition from authorization_rule
91100
*/
92-
$setup->startSetup();
93-
94-
$tableName = $setup->getTable('authorization_rule');
101+
$tableName = $this->moduleDataSetup->getTable('authorization_rule');
95102
if ($tableName) {
96-
$setup->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']);
103+
$this->moduleDataSetup->getConnection()->delete(
104+
$tableName,
105+
['resource_id = ?' => 'admin/system/tools/compiler']
106+
);
97107
}
108+
}
109+
110+
/**
111+
* {@inheritdoc}
112+
*/
113+
public static function getDependencies()
114+
{
115+
return [];
116+
}
98117

99-
$setup->endSetup();
118+
/**
119+
* {@inheritdoc}
120+
*/
121+
public static function getVersion()
122+
{
123+
return '2.0.0';
124+
}
125+
126+
/**
127+
* {@inheritdoc}
128+
*/
129+
public function getAliases()
130+
{
131+
return [];
100132
}
101133
}

app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testGetAllowedResourcesByUserTypeCustomer()
6060

6161
/**
6262
* @expectedException \Magento\Framework\Exception\AuthorizationException
63-
* @expectedExceptionMessage We can't find the role for the user you wanted.
63+
* @expectedExceptionMessage The role wasn't found for the user. Verify the role and try again.
6464
*/
6565
public function testGetAllowedResourcesByUserRoleNotFound()
6666
{

app/code/Magento/Authorization/etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Authorization" setup_version="2.0.0">
9+
<module name="Magento_Authorization" >
1010
<sequence>
1111
<module name="Magento_Backend"/>
1212
</sequence>

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Authorizenet\Controller\Directpost\Payment;
78

89
use Magento\Authorizenet\Controller\Directpost\Payment;
@@ -147,7 +148,7 @@ protected function placeCheckoutOrder()
147148
$result->setData('error', true);
148149
$result->setData(
149150
'error_messages',
150-
__('An error occurred on the server. Please try to place the order again.')
151+
__('A server error stopped your order from being placed. Please try to place your order again.')
151152
);
152153
}
153154
if ($response instanceof Http) {

0 commit comments

Comments
 (0)