Skip to content

Commit 50aa4b6

Browse files
committed
Merge branch '2.3-develop' into MQE-824
2 parents bbf2ba9 + b335359 commit 50aa4b6

File tree

1,020 files changed

+27732
-10816
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,020 files changed

+27732
-10816
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/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"/>

0 commit comments

Comments
 (0)