Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Restores backwards compatibility with TinyMCE plugins again (after it… #39262

Open
2 of 5 tasks
m2-assistant bot opened this issue Oct 15, 2024 · 2 comments · May be fixed by #39258
Open
2 of 5 tasks

[Issue] Restores backwards compatibility with TinyMCE plugins again (after it… #39262

m2-assistant bot opened this issue Oct 15, 2024 · 2 comments · May be fixed by #39258
Assignees
Labels
Issue: On Hold Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: PR in progress Reported on 2.4.7-p2 Indicates original Magento version for the Issue report.

Comments

@m2-assistant
Copy link

m2-assistant bot commented Oct 15, 2024

This issue is automatically created based on existing pull request: #39258: Restores backwards compatibility with TinyMCE plugins again (after it…


… broke with introduction of TinyMCE7).

Description (*)

Magento comes with 2 new TinyMCE plugins by default:

  • magentowidget
  • magentovariable

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 the magentowidget instance, because that last one was just an empty object:

TypeError: tinymce.activeEditor.plugins.magentowidget.encodeWidgets is not a function

This PR fixes that.

Related Pull Requests

Fixed Issues (if relevant)

  1. Doesn't appear to be working anymore with TinyMCE 7 Magenerds/PageDesigner#54

Manual testing scenarios (*)

  1. Setup Magento 2.4.7-p2 without magento's pagebuilder
  2. Install https://github.com/Magenerds/PageDesigner
  3. In the backoffice, create a new cms page, using the pagedesigner interface
  4. save the page
  5. now upgrade to Magento 2.4.7-p3 (still without magento's pagebuilder)
  6. Return to the backoffice, and start editing that new page created in step 4
  7. Open the 'content' tab and see if the pagedesigner interface is loading the content, also take a look at your browsers inspector.

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 (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
@m2-community-project m2-community-project bot added Issue: ready for confirmation Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. labels Oct 15, 2024
@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. label Oct 15, 2024
@engcom-Hotel engcom-Hotel self-assigned this Oct 23, 2024
Copy link
Author

m2-assistant bot commented Oct 23, 2024

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @hostep,

We are moving this issue On Hold due to the below issue:

#39252

The team is working on the rollback of TinyMCE with the previous version. We will pick up this issue whenever the activity is complete.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: On Hold Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: PR in progress Reported on 2.4.7-p2 Indicates original Magento version for the Issue report.
Projects
Status: Ready for Development
Development

Successfully merging a pull request may close this issue.

3 participants