Skip to content

Commit d2b9542

Browse files
committed
MC-22925: Backport template filter strict mode
1 parent 7efdeeb commit d2b9542

File tree

8 files changed

+55
-332
lines changed

8 files changed

+55
-332
lines changed

app/code/Magento/Email/Setup/Patch/Data/FlagLegacyTemplates.php

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Email\Setup;
8+
9+
use Magento\Framework\Setup\ModuleContextInterface;
10+
use Magento\Framework\Setup\SchemaSetupInterface;
11+
use Magento\Framework\Setup\UpgradeSchemaInterface;
12+
13+
/**
14+
* Upgrade the DB schema for email templates
15+
*/
16+
class UpgradeSchema implements UpgradeSchemaInterface
17+
{
18+
/**
19+
* {@inheritdoc}
20+
*/
21+
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
22+
{
23+
if (version_compare($context->getVersion(), '2.0.1', '<')) {
24+
$connection = $setup->getConnection();
25+
$connection->addColumn(
26+
$setup->getTable('email_template'),
27+
'is_legacy',
28+
[
29+
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
30+
'nullable' => false,
31+
'default' => 0,
32+
'comment' => 'Should the template render in legacy mode',
33+
]
34+
);
35+
$connection->update($setup->getTable('email_template'), ['is_legacy' => '1']);
36+
}
37+
}
38+
}

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

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

app/code/Magento/Email/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_Email" setup_version="2.0.0">
9+
<module name="Magento_Email" setup_version="2.0.1">
1010
<sequence>
1111
<module name="Magento_Store"/>
1212
<module name="Magento_Cms"/>

app/code/Magento/Newsletter/Setup/Patch/Data/FlagLegacyTemplates.php

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

app/code/Magento/Newsletter/Setup/UpgradeSchema.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
3131
);
3232
}
3333

34+
if (version_compare($context->getVersion(), '2.0.2', '<')) {
35+
$connection = $setup->getConnection();
36+
$connection->addColumn(
37+
$setup->getTable('newsletter_template'),
38+
'is_legacy',
39+
[
40+
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
41+
'nullable' => false,
42+
'default' => 0,
43+
'comment' => 'Should the template render in legacy mode',
44+
]
45+
);
46+
$connection->update($setup->getTable('newsletter_template'), ['is_legacy' => '1']);
47+
}
48+
3449
$setup->endSetup();
3550
}
3651
}

0 commit comments

Comments
 (0)