Previously fixed isses with TinyMCE have not been backported in latest security patch
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 12.2k
- Forks
- 9.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions and environment
With the downgrade from TinyMCE 7 back to version 6 a few previously fixed issues have been reintroduced. Namely #39262 and #39263.
For #39263 the relevant change done in https://github.com/magento/magento2/commit/d1b5797e448ae6b8811b4faa4b53843f816408e5 is only present in the `2.4.8-beta2` release tag. In all four release tags of the latest security patch (`2.4.4-p12`, `2.4.5-p11`, `2.4.6-p9` and `2.4.7-p4`) the exclude path still refers to the now incorrect `/tiny_mce/` path.
Similarly, the PR which fixes #39262 (https://github.com/magento/magento2/pull/39258/files, https://github.com/magento/magento2/commit/a71df1613e60de64eee7b661d54e1a68a2b8ed0d) is not present in any of the latest tags as well.
### Steps to reproduce
The erroneous behaviour of #39263 can be reproduced by enabling production mode and javascript minification and attempting to use TinyMCE in the admin area.
#39262 is not triggered in the default configuration. The plugins are attempted to be loaded if, as described in the original issue, one has the module `Magenerds_PageDesigner` installed (see: https://github.com/Magenerds/PageDesigner/issues/54).
### Expected result
TinyMCE 6 works in the default configuration with JavaScript minification enabled and `Magenerds_PageDesigner` (or any other method of attempting to load the plugins in the editor) installed.
### Actual result
TinyMCE6 fails to load in the aforementioned circumstances.
### Additional information
This can be worked around manually.
#39263 can be fixed by adding something akin to:
```php
'system' => [
'default' => [
'dev' => [
'js' => [
'minify_files' => '1',
'minify_exclude' => [
'tiny_mce_6' => '/tiny_mce_6/',
]
],
'css' => [
'minify_files' => '1',
'minify_exclude' => [
'tiny_mce_6' => '/tiny_mce_6/',
]
]
]
]
]
```
to `config.php`.
#39262 can only be fixed by manually patching the contents of `lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js` and `lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js`. Both paths are located in the `lib` directory which is supposed to be added by the installation process and not be edited manually. This introduces additional maintenance load for every installation, as the change will have to be manually carried over for each subsequent patch in which the bug is still present.
### Release note
_No response_
### Triage and priority
- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
- [x] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the latest security-patch release tags with the changes from #39262 and #39263, starting with the TinyMCE minification configuration and the two editor_plugin.js files under lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/. Verify the fixes are present for TinyMCE 6 in all four affected release tags and that production-mode JavaScript minification works with the editor and plugin-loading scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100