Skip to content

Commit ad9705e

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into 2.3-develop-pr25
2 parents 1784a1a + 92b9a39 commit ad9705e

File tree

76 files changed

+1378
-162
lines changed

Some content is hidden

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

76 files changed

+1378
-162
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,7 @@
18091809
<constraint xsi:type="foreign" name="CAT_PRD_FRONTEND_ACTION_CSTR_ID_CSTR_ENTT_ENTT_ID"
18101810
table="catalog_product_frontend_action" column="customer_id" referenceTable="customer_entity"
18111811
referenceColumn="entity_id" onDelete="CASCADE"/>
1812-
<constraint xsi:type="foreign" name="PRODUCT_FRONTEND_ACTION_PRODUCT_ID"
1812+
<constraint xsi:type="foreign" name="CAT_PRD_FRONTEND_ACTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
18131813
table="catalog_product_frontend_action" column="product_id" referenceTable="catalog_product_entity"
18141814
referenceColumn="entity_id" onDelete="CASCADE" />
18151815
<constraint xsi:type="unique" name="CATALOG_PRODUCT_FRONTEND_ACTION_VISITOR_ID_PRODUCT_ID_TYPE_ID">

app/code/Magento/Catalog/etc/db_schema_whitelist.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,8 @@
10961096
"index": {
10971097
"CAT_CTGR_PRD_IDX_REPLICA_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY": true,
10981098
"IDX_87EB2E3059853CF89A75B4C55074810B": true,
1099-
"CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY": true
1099+
"CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY": true,
1100+
"CAT_CTGR_PRD_IDX_STORE_ID_CTGR_ID_VISIBILITY_IS_PARENT_POSITION": true
11001101
},
11011102
"constraint": {
11021103
"PRIMARY": true
@@ -1114,8 +1115,9 @@
11141115
"constraint": {
11151116
"PRIMARY": true,
11161117
"CAT_PRD_FRONTEND_ACTION_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
1118+
"CAT_PRD_FRONTEND_ACTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID": true,
11171119
"CATALOG_PRODUCT_FRONTEND_ACTION_VISITOR_ID_PRODUCT_ID_TYPE_ID": true,
11181120
"CATALOG_PRODUCT_FRONTEND_ACTION_CUSTOMER_ID_PRODUCT_ID_TYPE_ID": true
11191121
}
11201122
}
1121-
}
1123+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<constraint xsi:type="primary" name="PRIMARY">
6161
<column name="rule_product_id"/>
6262
</constraint>
63-
<constraint xsi:type="unique" name="IDX_EAA51B56FF092A0DCB795D1CEF812B7B">
63+
<constraint xsi:type="unique" name="UNQ_EAA51B56FF092A0DCB795D1CEF812B7B">
6464
<column name="rule_id"/>
6565
<column name="from_time"/>
6666
<column name="to_time"/>
@@ -198,7 +198,7 @@
198198
<constraint xsi:type="primary" name="PRIMARY">
199199
<column name="rule_product_id"/>
200200
</constraint>
201-
<constraint xsi:type="unique" name="IDX_EAA51B56FF092A0DCB795D1CEF812B7B">
201+
<constraint xsi:type="unique" name="UNQ_EAA51B56FF092A0DCB795D1CEF812B7B">
202202
<column name="rule_id"/>
203203
<column name="from_time"/>
204204
<column name="to_time"/>

app/code/Magento/CatalogRule/etc/db_schema_whitelist.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
},
5050
"constraint": {
5151
"PRIMARY": true,
52-
"IDX_EAA51B56FF092A0DCB795D1CEF812B7B": true
52+
"IDX_EAA51B56FF092A0DCB795D1CEF812B7B": true,
53+
"UNQ_EAA51B56FF092A0DCB795D1CEF812B7B": true
5354
}
5455
},
5556
"catalogrule_product_price": {
@@ -146,7 +147,8 @@
146147
},
147148
"constraint": {
148149
"PRIMARY": true,
149-
"UNQ_BDF2B92A4F0B28D7896648B3B8A26089": true
150+
"IDX_EAA51B56FF092A0DCB795D1CEF812B7B": true,
151+
"UNQ_EAA51B56FF092A0DCB795D1CEF812B7B": true
150152
}
151153
},
152154
"catalogrule_product_price_replica": {
@@ -190,4 +192,4 @@
190192
"PRIMARY": true
191193
}
192194
}
193-
}
195+
}

app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
*/
2323
class TablesWhitelistGenerateCommand extends Command
2424
{
25-
/**
26-
* Whitelist file name.
27-
*/
28-
const GENERATED_FILE_NAME = 'db_schema_whitelist.json';
29-
3025
/**
3126
* Module name key, that will be used in whitelist generate command.
3227
*/
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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\Developer\Model\Logger\Handler;
9+
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
11+
use Magento\Framework\App\DeploymentConfig;
12+
13+
/**
14+
* Enable/disable syslog logging based on the store config setting.
15+
*/
16+
class Syslog extends \Magento\Framework\Logger\Handler\Syslog
17+
{
18+
public const CONFIG_PATH = 'dev/syslog/syslog_logging';
19+
20+
/**
21+
* Scope config.
22+
*
23+
* @var ScopeConfigInterface
24+
*/
25+
private $scopeConfig;
26+
27+
/**
28+
* Deployment config.
29+
*
30+
* @var DeploymentConfig
31+
*/
32+
private $deploymentConfig;
33+
34+
/**
35+
* @param ScopeConfigInterface $scopeConfig Scope config
36+
* @param DeploymentConfig $deploymentConfig Deployment config
37+
* @param string $ident The string ident to be added to each message
38+
*/
39+
public function __construct(
40+
ScopeConfigInterface $scopeConfig,
41+
DeploymentConfig $deploymentConfig,
42+
string $ident
43+
) {
44+
parent::__construct($ident);
45+
46+
$this->scopeConfig = $scopeConfig;
47+
$this->deploymentConfig = $deploymentConfig;
48+
}
49+
50+
/**
51+
* @inheritdoc
52+
*/
53+
public function isHandling(array $record): bool
54+
{
55+
return parent::isHandling($record)
56+
&& $this->deploymentConfig->isAvailable()
57+
&& $this->scopeConfig->getValue(self::CONFIG_PATH);
58+
}
59+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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\Developer\Test\Unit\Model\Logger\Handler;
9+
10+
use Magento\Developer\Model\Logger\Handler\Syslog;
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Framework\App\DeploymentConfig;
13+
use Magento\Framework\Logger\Monolog;
14+
use PHPUnit\Framework\TestCase;
15+
use PHPUnit_Framework_MockObject_MockObject as Mock;
16+
17+
/**
18+
* @inheritdoc
19+
*/
20+
class SyslogTest extends TestCase
21+
{
22+
/**
23+
* @var Syslog
24+
*/
25+
private $model;
26+
27+
/**
28+
* @var ScopeConfigInterface|Mock
29+
*/
30+
private $scopeConfigMock;
31+
32+
/**
33+
* @var DeploymentConfig|Mock
34+
*/
35+
private $deploymentConfigMock;
36+
37+
protected function setUp()
38+
{
39+
$this->scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
40+
$this->deploymentConfigMock = $this->createMock(DeploymentConfig::class);
41+
42+
$this->model = new Syslog(
43+
$this->scopeConfigMock,
44+
$this->deploymentConfigMock,
45+
'Magento'
46+
);
47+
}
48+
49+
public function testIsHandling(): void
50+
{
51+
$record = [
52+
'level' => Monolog::DEBUG,
53+
];
54+
55+
$this->scopeConfigMock->expects($this->once())
56+
->method('getValue')
57+
->with(Syslog::CONFIG_PATH)
58+
->willReturn('1');
59+
$this->deploymentConfigMock->expects($this->once())
60+
->method('isAvailable')
61+
->willReturn(true);
62+
63+
$this->assertTrue(
64+
$this->model->isHandling($record)
65+
);
66+
}
67+
68+
public function testIsHandlingNotInstalled(): void
69+
{
70+
$record = [
71+
'level' => Monolog::DEBUG,
72+
];
73+
74+
$this->scopeConfigMock->expects($this->never())
75+
->method('getValue');
76+
$this->deploymentConfigMock->expects($this->once())
77+
->method('isAvailable')
78+
->willReturn(false);
79+
80+
$this->assertFalse(
81+
$this->model->isHandling($record)
82+
);
83+
}
84+
85+
public function testIsHandlingDisabled(): void
86+
{
87+
$record = [
88+
'level' => Monolog::DEBUG,
89+
];
90+
91+
$this->scopeConfigMock->expects($this->once())
92+
->method('getValue')
93+
->with(Syslog::CONFIG_PATH)
94+
->willReturn('0');
95+
$this->deploymentConfigMock->expects($this->once())
96+
->method('isAvailable')
97+
->willReturn(true);
98+
99+
$this->assertFalse(
100+
$this->model->isHandling($record)
101+
);
102+
}
103+
}

app/code/Magento/Developer/etc/adminhtml/system.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
3333
</field>
3434
</group>
35+
<group id="syslog" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
36+
<label>Syslog</label>
37+
<field id="syslog_logging" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
38+
<label>Log to Syslog</label>
39+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
40+
</field>
41+
</group>
3542
</section>
3643
</system>
3744
</config>

app/code/Magento/Developer/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<preference for="Magento\Framework\Logger\Handler\Debug" type="Magento\Developer\Model\Logger\Handler\Debug"/>
10+
<preference for="Magento\Framework\Logger\Handler\Syslog" type="Magento\Developer\Model\Logger\Handler\Syslog"/>
1011

1112
<type name="Magento\Framework\View\Result\Page">
1213
<arguments>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
<column name="attribute_set_id"/>
378378
<column name="attribute_group_name"/>
379379
</constraint>
380-
<constraint xsi:type="unique" name="CATALOG_CATEGORY_PRODUCT_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE">
380+
<constraint xsi:type="unique" name="EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE">
381381
<column name="attribute_set_id"/>
382382
<column name="attribute_group_code"/>
383383
</constraint>

0 commit comments

Comments
 (0)