Skip to content

Commit 3fcfcbd

Browse files
Merge pull request #5973 from magento-borg/MC-34648
[CIA] Bugfixes
2 parents 5311709 + 2783c37 commit 3fcfcbd

File tree

27 files changed

+147
-59
lines changed

27 files changed

+147
-59
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@
9999
</section>
100100
<section name="ProductWYSIWYGSection">
101101
<element name="Switcher" type="button" selector="//select[@id='dropdown-switcher']"/>
102-
<element name="v436" type ="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 4.3.6']" />
103-
<element name="v3" type ="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 3.6(Deprecated)']" />
102+
<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'"/>
103+
<element name="v3" type ="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 3.6(Deprecated)']" deprecated="This version of tinymce is no longer supported. Please use 'ProductWYSIWYGSection.v4910'"/>
104+
<element name="v4910" type ="button" selector="//select[@id='dropdown-switcher']/option[text()='TinyMCE 4.9.10']" />
104105
<element name="TinymceDescription3" type ="button" selector="//span[text()='Description']" />
105106
<element name="SaveConfig" type ="button" selector="#save" />
106107
<element name="v4" type="button" selector="#category_form_description_v4"/>

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.xml

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

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

Lines changed: 9 additions & 6 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="This version of TinyMCE 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="MAJOR"/>
1919
<testCaseId value="MAGETWO-95725"/>
20+
<skip>
21+
<issueId value="DEPRECATED">This version of TinyMCE is no longer supported</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -34,11 +37,11 @@
3437
<waitForPageLoad stepKey="wait5"/>
3538
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle2"/>
3639
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab2" />
37-
<waitForElementVisible selector="{{TinyMCESection.TinyMCE3}}" stepKey="waitForTinyMCE3"/>
38-
<seeElement selector="{{TinyMCESection.TinyMCE3}}" stepKey="seeTinyMCE3" />
40+
<comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/>
41+
<comment userInput="removing deprecated element" stepKey="seeTinyMCE3" />
3942
<wait time="3" stepKey="waiting"/>
4043
<comment userInput="Click Insert image button" stepKey="clickImageButton"/>
41-
<click selector="{{TinyMCESection.InsertImageBtnTinyMCE3}}" stepKey="clickInsertImage" />
44+
<comment userInput="removing deprecated element" stepKey="clickInsertImage" />
4245
<waitForPageLoad stepKey="waitForiFrameToLoad" />
4346
<!-- Switch to the Edit/Insert Image iFrame -->
4447
<comment userInput="Switching to iFrame" stepKey="insertImageiFrame"/>
@@ -59,12 +62,12 @@
5962
<executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable2"/>
6063
<switchToIFrame selector="insert-image" stepKey="switchToIFrame2"/>
6164
<waitForElementVisible selector="{{MediaGallerySection.insertBtn}}" stepKey="waitForInsertBtnOnIFrame" />
62-
<fillField selector="{{MediaGallerySection.ImageDescriptionTinyMCE3}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription" />
65+
<fillField selector="{{MediaGallerySection.ImageDescriptionTinyMCE4}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription" />
6366
<click selector="{{MediaGallerySection.insertBtn}}" stepKey="clickInsertBtn" />
6467
<waitForPageLoad stepKey="wait3"/>
6568
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
6669
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/>
6770
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
6871
<see userInput="You saved the page." stepKey="seeSuccessMessage"/>
6972
</test>
70-
</tests>
73+
</tests>
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/ConfigWYSIWYGActionGroup.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
<magentoCLI stepKey="enableWYSIWYG" command="config:set cms/wysiwyg/enabled enabled"/>
2121
</actionGroup>
2222

23-
<actionGroup name="SwitchToTinyMCE3">
23+
<!--
24+
NOTICE: SwitchToTinyMCE3 is deprecated.
25+
-->
26+
<actionGroup name="SwitchToTinyMCE3" deprecated="This version of TinyMCE is no longer supported">
2427
<annotations>
25-
<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>
28+
<description>DEPRECATED. 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>
2629
</annotations>
2730

2831
<comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/>
@@ -55,7 +58,7 @@
5558
<arguments>
5659
<argument name="value" defaultValue="Yes" type="string"/>
5760
</arguments>
58-
61+
5962
<amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/>
6063
<waitForPageLoad stepKey="waitForPageLoad1"/>
6164
<conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/>
@@ -70,7 +73,7 @@
7073
<annotations>
7174
<description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Enable WYSIWYG Editor' to 'Enabled by Default'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
7275
</annotations>
73-
76+
7477
<amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/>
7578
<waitForPageLoad stepKey="waitForPageLoad"/>
7679
<conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="ProductWYSIWYGSection">
12-
<element name="Tinymce3MSG" type="button" selector=".admin__field-error"/>
12+
<element name="Tinymce3MSG" type="button" selector=".admin__field-error" deprecated="this version of tinyMCE is no longer supported"/>
1313
</section>
1414
<section name="TinyMCESection">
15-
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl"/>
16-
<element name="InsertImageBtnTinyMCE3" type="button" selector="#cms_page_form_content_image"/>
15+
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl" deprecated="this version of tinyMCE is no longer supported"/>
16+
<element name="InsertImageBtnTinyMCE3" type="button" selector="#cms_page_form_content_image" deprecated="this version of tinyMCE is no longer supported"/>
1717
</section>
1818
<section name="NewsletterWYSIWYGSection">
19-
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl"/>
19+
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl" deprecated="this version of tinyMCE is no longer supported"/>
2020
</section>
2121
</sections>

app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
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="AdminSwitchWYSIWYGOptionsTest">
11+
<test name="AdminSwitchWYSIWYGOptionsTest" deprecated="This version of TinyMCE is no longer supporte">
1212
<annotations>
1313
<features value="Cms"/>
1414
<stories value="MAGETWO-51829-Extensible list of WYSIWYG editors available in Magento"/>
1515
<group value="Cms"/>
16-
<title value="Admin should able to switch between versions of TinyMCE"/>
17-
<description value="Admin should able to switch between versions of TinyMCE"/>
16+
<title value="DEPRECATED. Admin should able to switch between versions of TinyMCE"/>
17+
<description value="DEPRECATED. Admin should able to switch between versions of TinyMCE"/>
1818
<severity value="CRITICAL"/>
1919
<testCaseId value="MC-6114"/>
20+
<skip>
21+
<issueId value="DEPRECATED">This version of TinyMCE is no longer supported</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
@@ -63,8 +66,8 @@
6366
<waitForPageLoad stepKey="wait5"/>
6467
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle2"/>
6568
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab2" />
66-
<waitForElementVisible selector="{{TinyMCESection.TinyMCE3}}" stepKey="waitForTinyMCE3"/>
67-
<seeElement selector="{{TinyMCESection.TinyMCE3}}" stepKey="seeTinyMCE3" />
69+
<comment userInput="removing deprecated element" stepKey="waitForTinyMCE3"/>
70+
<comment userInput="removing deprecated element" stepKey="seeTinyMCE3" />
6871
<executeJS function="tinyMCE.activeEditor.setContent('Hello TinyMCE3!');" stepKey="executeJSFillContent2"/>
6972
<click selector="{{CmsWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtn2" />
7073
<scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab2" />

app/code/Magento/Tinymce3/etc/adminhtml/di.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,4 @@
3939
</argument>
4040
</arguments>
4141
</type>
42-
<type name="Magento\Cms\Model\Config\Source\Wysiwyg\Editor">
43-
<arguments>
44-
<argument name="adapterOptions" xsi:type="array">
45-
<item name="tinymce3" xsi:type="array">
46-
<item name="value" xsi:type="const">Magento\Tinymce3\Model\Config\Source\Wysiwyg\Editor::WYSIWYG_EDITOR_CONFIG_VALUE</item>
47-
<item name="label" xsi:type="string" translatable="true">TinyMCE 3 (deprecated)</item>
48-
</item>
49-
</argument>
50-
</arguments>
51-
</type>
5242
</config>

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,4 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9-
<type name="Magento\Ui\Block\Wysiwyg\ActiveEditor">
10-
<arguments>
11-
<argument name="availableAdapterPaths" xsi:type="array">
12-
<item name="Magento_Tinymce3/tinymce3Adapter" xsi:type="string"/>
13-
</argument>
14-
</arguments>
15-
</type>
169
</config>

0 commit comments

Comments
 (0)