Skip to content

Commit 82b6b89

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento/magento2ce into PR-08-10-2020
2 parents 2b03ff9 + d822601 commit 82b6b89

File tree

41 files changed

+599
-265
lines changed

Some content is hidden

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

41 files changed

+599
-265
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/ProductWYSIWYGSection.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="ProductWYSIWYGSection">
1111
<element name="Switcher" type="button" selector="select#dropdown-switcher"/>
12-
<element name="v436" type="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 4.3.6']"/>
13-
<element name="v3" type="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 3.6(Deprecated)']"/>
12+
<element name="v436" type="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 4.3.6']" deprecated="New element was introduced. Please use 'ProductWYSIWYGSection.v4910'"/>
13+
<element name="v3" type="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 3.6(Deprecated)']" deprecated="New element was introduced. Please use 'ProductWYSIWYGSection.v4910'"/>
14+
<element name="v4910" type ="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 4.9.10']" />
1415
<element name="TinymceDescription3" type="button" selector="//span[text()='Description']"/>
1516
<element name="SaveConfig" type="button" selector="#save"/>
1617
<element name="v4" type="button" selector="#category_form_description_v4"/>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
*/
66

77
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
8+
$blockId = $block->getId();
89
?>
9-
<div id="product_composite_configure" class="product-configure-popup">
10+
<div id="product_composite_configure"
11+
class="product-configure-popup product-configure-popup-<?= $block->escapeHtmlAttr($blockId) ?>">
1012
<iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe"></iframe>
1113
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
1214
'onload',
@@ -31,40 +33,45 @@
3133
</form>
3234
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
3335
'onsubmit',
34-
"productConfigure.onConfirmBtn();event.preventDefault()",
36+
'productConfigure.onConfirmBtn();event.preventDefault()',
3537
'.product_composite_configure_form:last-of-type'
3638
) ?>
3739

3840
<div id="product_composite_configure_confirmed" class="product_composite_configure_confirmed"></div>
3941

4042
<?php $scriptString = <<<script
41-
prodCompConfIframe = document.querySelector("iframe[name='product_composite_configure_iframe']:last-of-type");
43+
prodCompConfIframe = document.querySelector(
44+
".product-configure-popup-$blockId iframe[name='product_composite_configure_iframe']"
45+
);
4246
prodCompConfIframe.style.width = 0;
4347
prodCompConfIframe.style.height = 0;
4448
prodCompConfIframe.style.border = "0px solid #fff";
4549
prodCompConfIframe.style.position = "absolute";
4650
prodCompConfIframe.style.top = "-1000px";
4751
prodCompConfIframe.style.left = "-1000px";
48-
prodCompConfMessages = document.querySelectorAll(".product_composite_configure_messages");
49-
for (var i = 0; i < prodCompConfMessages.length; i++) {
50-
prodCompConfMessages[i].style.display = "none";
51-
}
52-
prodCompConfFormAdd = document.querySelectorAll(".product_composite_configure_form_additional");
53-
for (var i = 0; i < prodCompConfFormAdd.length; i++) {
54-
prodCompConfFormAdd[i].style.display = "none";
55-
}
56-
prodCompConfFormConf = document.querySelectorAll(".product_composite_configure_form_confirmed");
57-
for (var i = 0; i < prodCompConfFormConf.length; i++) {
58-
prodCompConfFormConf[i].style.display = "none";
59-
}
60-
prodCompConfConf = document.querySelectorAll(".product_composite_configure_confirmed");
61-
for (var i = 0; i < prodCompConfConf.length; i++) {
62-
prodCompConfConf[i].style.display = "none";
63-
}
64-
prodConfPopup = document.querySelectorAll(".product-configure-popup");
65-
for (var i = 0; i < prodConfPopup.length; i++) {
66-
prodConfPopup[i].style.display = "none";
67-
}
52+
53+
prodCompConfMessages = document.querySelector(
54+
".product-configure-popup-$blockId .product_composite_configure_messages"
55+
);
56+
prodCompConfMessages.style.display = "none";
57+
58+
prodCompConfFormAdd = document.querySelector(
59+
".product-configure-popup-$blockId .product_composite_configure_form_additional"
60+
);
61+
prodCompConfFormAdd.style.display = "none";
62+
63+
prodCompConfFormConf = document.querySelector(
64+
".product-configure-popup-$blockId .product_composite_configure_form_confirmed"
65+
);
66+
prodCompConfFormConf.style.display = "none";
67+
68+
prodCompConfConf = document.querySelector(
69+
".product-configure-popup-$blockId .product_composite_configure_confirmed"
70+
);
71+
prodCompConfConf.style.display = "none";
72+
73+
prodConfPopup = document.querySelector(".product-configure-popup-$blockId");
74+
prodConfPopup.style.display = "none";
6875
6976
require([
7077
"jquery",

app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<data key="scope_id">0</data>
1919
<data key="value">hidden</data>
2020
</entity>
21-
<entity name="WysiwygTinyMCE3Enable">
21+
<entity name="WysiwygTinyMCE3Enable" deprecated="Use WysiwygTinyMCE4Enable instead">
2222
<data key="path">cms/wysiwyg/editor</data>
2323
<data key="scope_id">0</data>
2424
<data key="value">Magento_Tinymce3/tinymce3Adapter</data>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<element name="imageSelected" type="text" selector="//small[text()='{{var1}}']/parent::*[@class='filecnt selected']" parameterized="true"/>
1818
<element name="ImageSource" type="input" selector=".mce-combobox.mce-abs-layout-item.mce-last.mce-has-open"/>
1919
<element name="ImageDescription" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-last"/>
20-
<element name="ImageDescriptionTinyMCE3" type="input" selector="#alt"/>
20+
<element name="ImageDescriptionTinyMCE3" type="input" selector="#alt" deprecated="Deprecated New element was introduced. Please use 'ImageDescriptionTinyMCE4'"/>
21+
<element name="ImageDescriptionTinyMCE4" type="input" selector="#alt" />
2122
<element name="Height" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-first"/>
2223
<element name="UploadImage" type="file" selector=".fileupload"/>
2324
<element name="OkBtn" type="button" selector="//span[text()='Ok']"/>

app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminAddImageToCMSPageTinyMCE3Test">
11+
<test name="AdminAddImageToCMSPageTinyMCE3Test" deprecated="TinyMCE3 is no longer supported">
1212
<annotations>
1313
<features value="Cms"/>
1414
<stories value="Admin should be able to upload images with TinyMCE3 WYSIWYG"/>
@@ -17,6 +17,9 @@
1717
<description value="Verify that admin is able to upload image to CMS Page with TinyMCE3 enabled"/>
1818
<severity value="BLOCKER"/>
1919
<testCaseId value="MAGETWO-95725"/>
20+
<skip>
21+
<issueId value="DEPRECATED">TinyMCE3 is no longer supported</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
@@ -38,11 +41,11 @@
3841
<waitForPageLoad stepKey="wait5"/>
3942
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle2"/>
4043
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab2" />
41-
<waitForElementVisible selector="{{TinyMCESection.TinyMCE3}}" stepKey="waitForTinyMCE3"/>
42-
<seeElement selector="{{TinyMCESection.TinyMCE3}}" stepKey="seeTinyMCE3" />
44+
<comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/>
45+
<comment userInput="removing deprecated element" stepKey="seeTinyMCE3" />
4346
<wait time="3" stepKey="waiting"/>
4447
<comment userInput="Click Insert image button" stepKey="clickImageButton"/>
45-
<click selector="{{TinyMCESection.InsertImageBtnTinyMCE3}}" stepKey="clickInsertImage" />
48+
<comment userInput="removing deprecated element" stepKey="clickInsertImage" />
4649
<waitForPageLoad stepKey="waitForiFrameToLoad" />
4750
<!-- Switch to the Edit/Insert Image iFrame -->
4851
<comment userInput="Switching to iFrame" stepKey="insertImageiFrame"/>
@@ -66,7 +69,7 @@
6669
<executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable2"/>
6770
<switchToIFrame selector="insert-image" stepKey="switchToIFrame2"/>
6871
<waitForElementVisible selector="{{MediaGallerySection.insertBtn}}" stepKey="waitForInsertBtnOnIFrame" />
69-
<fillField selector="{{MediaGallerySection.ImageDescriptionTinyMCE3}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription" />
72+
<comment userInput="removing deprecated element" stepKey="fillImageDescription" />
7073
<click selector="{{MediaGallerySection.insertBtn}}" stepKey="clickInsertBtn" />
7174
<waitForPageLoad stepKey="wait3"/>
7275
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
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\Config\Setup\Patch\Data;
8+
9+
use Magento\Framework\Setup\Patch\DataPatchInterface;
10+
use Magento\Framework\Setup\Patch\PatchVersionInterface;
11+
use Magento\Framework\Setup\ModuleDataSetupInterface;
12+
13+
/**
14+
* Update config to Tinymce4 if Tinymce3 adapter is used.
15+
*/
16+
class UnsetTinymce3 implements DataPatchInterface, PatchVersionInterface
17+
{
18+
/**
19+
* @var ModuleDataSetupInterface
20+
*/
21+
private $moduleDataSetup;
22+
23+
/**
24+
* CreateDefaultPages constructor.
25+
* @param ModuleDataSetupInterface $moduleDataSetup
26+
*/
27+
public function __construct(
28+
ModuleDataSetupInterface $moduleDataSetup
29+
) {
30+
$this->moduleDataSetup = $moduleDataSetup;
31+
}
32+
33+
/**
34+
* @inheritdoc
35+
*/
36+
public function apply()
37+
{
38+
try {
39+
$connection = $this->moduleDataSetup->getConnection();
40+
$table = $this->moduleDataSetup->getTable('core_config_data');
41+
$select = $connection
42+
->select()
43+
->from(
44+
$table,
45+
['value']
46+
)
47+
->where('path = ?', 'cms/wysiwyg/editor');
48+
49+
if (strpos($connection->fetchOne($select), 'Tinymce3/tinymce3Adapter') !== false) {
50+
$row = [
51+
'value' => 'mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter'
52+
];
53+
$where = $connection->quoteInto(
54+
'path = ?',
55+
'cms/wysiwyg/editor'
56+
);
57+
$connection->update(
58+
$table,
59+
$row,
60+
$where
61+
);
62+
}
63+
return $this;
64+
} catch (\Exception $e) {
65+
return $this;
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.3.6';
83+
}
84+
85+
/**
86+
* @inheritdoc
87+
*/
88+
public function getAliases()
89+
{
90+
return [];
91+
}
92+
}

app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="SwitchToTinyMCE3ActionGroup">
11+
<actionGroup name="SwitchToTinyMCE3ActionGroup" deprecated="This version of TinyMCE is no longer supported">
1212
<annotations>
1313
<description>Goes to the 'Configuration' page for 'Content Management'. Sets 'WYSIWYG Editor' to 'TinyMCE 3'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
1414
</annotations>

app/code/Magento/Paypal/Model/AbstractConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract class AbstractConfig implements ConfigInterface
5858
/**
5959
* @var string
6060
*/
61-
private static $bnCode = 'Magento_Cart_%s';
61+
private static $bnCode = 'Magento_2_%s';
6262

6363
/**
6464
* @var \Magento\Framework\App\Config\ScopeConfigInterface

app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
1717

18+
/**
19+
* Test for \Magento\Paypal\Model\AbstractConfig
20+
*/
1821
class AbstractConfigTest extends TestCase
1922
{
2023

@@ -353,7 +356,7 @@ public function testGetBuildNotationCode()
353356
$productMetadata
354357
);
355358

356-
self::assertEquals('Magento_Cart_SomeEdition', $this->config->getBuildNotationCode());
359+
self::assertEquals('Magento_2_SomeEdition', $this->config->getBuildNotationCode());
357360
}
358361

359362
/**

app/code/Magento/Tinymce3/Test/Mftf/Section/AdminTinymce3FileldsSection/NewsletterWYSIWYGSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="NewsletterWYSIWYGSection">
11-
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl"/>
11+
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl" deprecated="This version of TinyMCE is no longer supported"/>
1212
</section>
1313
</sections>

0 commit comments

Comments
 (0)