Skip to content

Commit b817af4

Browse files
Merge pull request #5976 from magento-borg/MC-34573
[CIA] Bugfixes
2 parents 2d65211 + d3e9c19 commit b817af4

File tree

29 files changed

+138
-53
lines changed

29 files changed

+138
-53
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/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/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>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10-
<section name="ProductWYSIWYGSection">
10+
<section name="ProductWYSIWYGSection" deprecated="This version of TinyMCE is no longer supported">
1111
<element name="Tinymce3MSG" type="button" selector=".admin__field-error"/>
1212
</section>
1313
</sections>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="TinyMCESection">
11-
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl"/>
12-
<element name="InsertImageBtnTinyMCE3" type="button" selector="#cms_page_form_content_image"/>
11+
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl" deprecated="Deprecated this version of TinyMCE is no longer supported"/>
12+
<element name="InsertImageBtnTinyMCE3" type="button" selector="#cms_page_form_content_image" deprecated="Deprecated this version of TinyMCE is no longer supported"/>
1313
</section>
1414
</sections>

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

Lines changed: 6 additions & 3 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="AdminSwitchWYSIWYGOptionsTest">
11+
<test name="AdminSwitchWYSIWYGOptionsTest" deprecated="TinyMCE3 is no longer supported">
1212
<annotations>
1313
<features value="Cms"/>
1414
<stories value="MAGETWO-51829-Extensible list of WYSIWYG editors available in Magento"/>
@@ -17,6 +17,9 @@
1717
<description value="Admin should able to switch between versions of TinyMCE"/>
1818
<severity value="CRITICAL"/>
1919
<testCaseId value="MC-6114"/>
20+
<skip>
21+
<issueId value="DEPRECATED">TinyMCE3 is no longer supported</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="AdminLoginActionGroup" 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>

app/code/Magento/Ui/DataProvider/Modifier/WysiwygModifierInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212
interface WysiwygModifierInterface
1313
{
1414
/**
15-
* Provide editor name
16-
* For example tmce3 or tmce4
15+
* Provide editor name for example tmce4
1716
*
1817
* @return array
1918
* @since 101.1.0
2019
*/
2120
public function getEditorName();
2221

2322
/**
23+
* Modifies the meta
24+
*
2425
* @param array $meta
26+
*
2527
* @return array
2628
* @since 101.1.0
2729
*/

0 commit comments

Comments
 (0)