Restores backwards compatibility with TinyMCE plugins again (after it… #39258
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… broke with introduction of TinyMCE7).
Description (*)
Magento comes with 2 new TinyMCE plugins by default:
Recently, with the switch from TinyMCE v5 to v7 in the latest security patch releases (2.4.7-p3, ...) and 2.4.8-beta1, those plugins got rewritten to adhere to the new system in TinyMCE 7. However, a big mistake was made by not returning the widgets as an object, which meant that you couldn't call the functions defined inside the plugin anymore when trying to use the widget from another location.
Example with magentowidget, old version vs new version, note that in the new version there is no object being returned in that
magentowidget
function anymore.This resulted in this error output when trying to call the
encodeWidgets
on themagentowidget
instance, because that last one was just an empty object:This PR fixes that.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
That last step will fail and you'll see an error in your browser's console. This PR fixes this issue.
Questions or comments
Adding automated tests for this will be hard, so I'm not doing it, hopefully that's okay, if not, please write them yourselves, I won't have the time to put into this task.
Contribution checklist (*)