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


We’ve been having some issues regarding the edx-sga xblock. When creating a new Staff Graded Assignment problem, the WYSIWIG editor is not showing:

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.

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. We even tried a temporary fix copying the silver theme into a modern theme folder in the CMS container : cp -r ./common/static/js/vendor/tinymce/js/tinymce/themes/silver/ ./common/static/js/vendor/tinymce/js/tinymce/themes/modern/, but we still got 404.

Any help would be appreciated.

I was able to reproduce the problem on the demo Open edX platform. Both the LMS and the CMS attempt to load the following file:


Which does not exist (404). But the file exists in the silver theme:


It seems to me that the bug does not stem from the edx-sga xblock, because this xblock does not contain any reference to the tinymce editor. Instead, I’d bet that the bug comes from edx-platform/common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js:


I’m not a tinymce expert, but I think that the package needs to be properly initialized with the ‘silver’ theme: Migrating from TinyMCE 4 to TinyMCE 5. | Docs | TinyMCE

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

I don’t have time right now, but someone should investigate whether this PR left out some theme migration code.

Yes, I’ve come to the same conclusions regarding that call at jquery.tinymce.min.js (I’ve even tried a hot fix changing “modern” to “silver” there with no luck).

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):

If you open an issue at Issues · mitodl/edx-sga · GitHub we can take a look.

May I ask why you are using SGA and ORA? Nearly all of the features in SGA have been replicated in ORA at this time.

(There’s one missing feature in ORA that I’m aware of, but it’s pretty obscure.)

Thanks @pdpinch! The thing is that we have several legacy courses using SGA problems a lot, but maybe we should take a look at migrating to ORA.

I’d just opened the issue: TinyMCE problem in edx-sga problems: `modern` theme not found · Issue #346 · mitodl/edx-sga · GitHub