mitodl / edx-sga

Staff Graded Assignment XBlock for the edX platform
GNU Affero General Public License v3.0
34 stars 109 forks source link

TinyMCE problem in edx-sga problems: `modern` theme not found #346

Closed angellareo closed 8 months ago

angellareo commented 1 year ago

When creating a new Staff Graded Assignment problem, the WYSIWIG editor is not showing: image

It seems that the problem comes from getting a 404 Not Found when retrieving /static/studio//js/vendor/tinymce/js/tinymce/themes/modern/theme.js, which in fact does not exist.

Which does exist is js/tinymce/themes/silver/theme.js (note that the path refers to a silver theme instead of `modern). According to this github issue, modern theme was replaced with silver in version 5.

Although there is no reference to tinymce in edx-sga xblock, other problem types such as ORA self-assessment work just great (loading the correct theme): image

TinyMCE was upgraded from v4 to v5 in this PR: https://github.com/openedx/edx-platform/pull/30335

The bug might comes from edx-platform/common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js:

"&themes="+escape(o.theme||"modern")

We’re at Palm version, deployed with tutor. We’ve been searching how to update the reference to use the TinyMCE silver theme, but with no luck until now.

I've also posted in Discuss about this issue, which has been reproduced on the Open edX demo platform.

Anas12091101 commented 10 months ago

This issue in the Palm release is due to the version of xblock-utils, which is 3.0.0. This version uses the modern theme for TinyMCE and doesn't support v5. A possible solution for this problem is to upgrade xblock-utils version in the edx-platform Palm release to 3.2.0 studio_edit.js file in version 3.0.0 and version 3.2.0 PR for above changes: https://github.com/openedx-unsupported/xblock-utils/pull/207

arslanashraf7 commented 8 months ago

@Anas12091101 We have had some version updates of xblock related packages lately. Is it time to circle back on this and see if there is a fix available now?

Otherwise, We should check if Palm release should support TinyMCE v5 and if we should create an upstream PR for that? @pdpinch

Anas12091101 commented 8 months ago

The PR has been merged in edx-platform palm release. We can now close this issue

arslanashraf7 commented 8 months ago

@angellareo We have got the fix merged into open-release/palm.master release of Open edX, You must pull the latest palm release to get the fix. Please don't hesitate to let us know if you see any issues.

Note: This should already have been fixed If you are using the latest master branch or the Quince release.