Skip to content

Commit e10a3ff

Browse files
Merge branch '2.3-develop' into forwardport-2.3-develop-magento-magento2-11539
# Conflicts: # lib/web/mage/adminhtml/form.js
2 parents 9775cd8 + 0f61d2d commit e10a3ff

File tree

1,689 files changed

+41259
-21081
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,689 files changed

+41259
-21081
lines changed

.php_cs.dist

Lines changed: 2 additions & 2 deletions
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')

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2)
1+
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.3-develop)](https://travis-ci.org/magento/magento2)
22
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
33
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)
44
<h2>Welcome</h2>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="adminnotification_inbox" resource="default" engine="innodb" comment="Adminnotification Inbox">
1111
<column xsi:type="int" name="notification_id" padding="10" unsigned="true" nullable="false" identity="true"
1212
comment="Notification id"/>

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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/Block/Adminhtml/System/Config/CollectionTimeLabel.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,45 @@
55
*/
66
namespace Magento\Analytics\Block\Adminhtml\System\Config;
77

8+
use Magento\Framework\App\ObjectManager;
9+
810
/**
911
* Provides label with default Time Zone
1012
*/
1113
class CollectionTimeLabel extends \Magento\Config\Block\System\Config\Form\Field
1214
{
1315
/**
14-
* Add default time zone to comment
16+
* @var \Magento\Framework\Locale\ResolverInterface
17+
*/
18+
private $localeResolver;
19+
20+
/**
21+
* @param \Magento\Backend\Block\Template\Context $context
22+
* @param array $data
23+
* @param \Magento\Framework\Locale\ResolverInterface|null $localeResolver
24+
*/
25+
public function __construct(
26+
\Magento\Backend\Block\Template\Context $context,
27+
array $data = [],
28+
\Magento\Framework\Locale\ResolverInterface $localeResolver = null
29+
) {
30+
$this->localeResolver = $localeResolver ?:
31+
ObjectManager::getInstance()->get(\Magento\Framework\Locale\ResolverInterface::class);
32+
parent::__construct($context, $data);
33+
}
34+
35+
/**
36+
* Add current time zone to comment, properly translated according to locale
1537
*
1638
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
1739
* @return string
1840
*/
1941
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
2042
{
2143
$timeZoneCode = $this->_localeDate->getConfigTimezone();
22-
$getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)->getDisplayName();
44+
$locale = $this->localeResolver->getLocale();
45+
$getLongTimeZoneName = \IntlTimeZone::createTimeZone($timeZoneCode)
46+
->getDisplayName(false, \IntlTimeZone::DISPLAY_LONG, $locale);
2347
$element->setData(
2448
'comment',
2549
sprintf("%s (%s)", $getLongTimeZoneName, $timeZoneCode)

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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 9 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

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

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Backend\Block\Template\Context;
1010
use Magento\Framework\Data\Form;
1111
use Magento\Framework\Data\Form\Element\AbstractElement;
12+
use Magento\Framework\Locale\ResolverInterface;
1213
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1314
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1415

@@ -34,6 +35,11 @@ class CollectionTimeLabelTest extends \PHPUnit\Framework\TestCase
3435
*/
3536
private $abstractElementMock;
3637

38+
/**
39+
* @var ResolverInterface|\PHPUnit_Framework_MockObject_MockObject
40+
*/
41+
private $localeResolver;
42+
3743
protected function setUp()
3844
{
3945
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
@@ -53,12 +59,17 @@ protected function setUp()
5359
$this->contextMock->expects($this->any())
5460
->method('getLocaleDate')
5561
->willReturn($this->timeZoneMock);
62+
$this->localeResolver = $this->getMockBuilder(ResolverInterface::class)
63+
->disableOriginalConstructor()
64+
->setMethods(['getLocale'])
65+
->getMockForAbstractClass();
5666

5767
$objectManager = new ObjectManager($this);
5868
$this->collectionTimeLabel = $objectManager->getObject(
5969
CollectionTimeLabel::class,
6070
[
61-
'context' => $this->contextMock
71+
'context' => $this->contextMock,
72+
'localeResolver' => $this->localeResolver
6273
]
6374
);
6475
}
@@ -73,6 +84,9 @@ public function testRender()
7384
$this->abstractElementMock->expects($this->any())
7485
->method('getComment')
7586
->willReturn('Eastern Standard Time (America/New_York)');
87+
$this->localeResolver->expects($this->once())
88+
->method('getLocale')
89+
->willReturn('en_US');
7690
$this->assertRegexp(
7791
"/Eastern Standard Time \(America\/New_York\)/",
7892
$this->collectionTimeLabel->render($this->abstractElementMock)

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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());

0 commit comments

Comments
 (0)