Tinymce tries to set its base url by iterating through "script" elements looking for scripts like tinymce.min.js, and uses the baseurl of the script src attribute for its own baseurl. However, we provide something like tinymce.min_19.1106000.js, which will never match. This is OK in browsers like Chrome which support document.currentScript as a fallback. But IE 11 doesn't support document.currentScript. The simple solution is just to provide "suffix" and "base_url" when running tinyMCE.init. It's no big drama, and it means tinymce will work better cross-browser.
Created attachment 105655 [details] [review] Bug 25697: Declare base url and suffix in tinymce init This patch declares the base url and suffix in tinymce init, so that tinymce will initialize properly cross-browser. Without this change, tinymce will fail to initialize on IE 11. Test plan: 0. Apply patch 1. Open IE 11 2. Enable "UseWYSIWYGinSystemPreferences" system preference 3. Go to /cgi-bin/koha/admin/preferences.pl?tab=opac and note that tinymce initializes correctly 4. Go to /cgi-bin/koha/tools/koha-news.pl and create/edit a news item, and note that tinymce initializes correctly 5. Go to /cgi-bin/koha/admin/branches.pl and add/edit a library, and note that tinymce initializes correctly for "OPAC info"
Why are the comments in this patch prefixed with "//ejb2020:" ?
(In reply to Owen Leonard from comment #2) > Why are the comments in this patch prefixed with "//ejb2020:" ? Because I'm upstreaming a local fix heh. I'll fix that.
Created attachment 106174 [details] [review] Bug 25697: Declare base url and suffix in tinymce init This patch declares the base url and suffix in tinymce init, so that tinymce will initialize properly cross-browser. Without this change, tinymce will fail to initialize on IE 11. Test plan: 0. Apply patch 1. Open IE 11 2. Enable "UseWYSIWYGinSystemPreferences" system preference 3. Go to /cgi-bin/koha/admin/preferences.pl?tab=opac and note that tinymce initializes correctly 4. Go to /cgi-bin/koha/tools/koha-news.pl and create/edit a news item, and note that tinymce initializes correctly 5. Go to /cgi-bin/koha/admin/branches.pl and add/edit a library, and note that tinymce initializes correctly for "OPAC info"
Created attachment 106208 [details] [review] Bug 25697: Declare base url and suffix in tinymce init This patch declares the base url and suffix in tinymce init, so that tinymce will initialize properly cross-browser. Without this change, tinymce will fail to initialize on IE 11. Test plan: 0. Apply patch 1. Open IE 11 2. Enable "UseWYSIWYGinSystemPreferences" system preference 3. Go to /cgi-bin/koha/admin/preferences.pl?tab=opac and note that tinymce initializes correctly 4. Go to /cgi-bin/koha/tools/koha-news.pl and create/edit a news item, and note that tinymce initializes correctly 5. Go to /cgi-bin/koha/admin/branches.pl and add/edit a library, and note that tinymce initializes correctly for "OPAC info" Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
I cannot test with IE, but I confirm that it is still working with Firefox. However, it doesn't make much sense to append koha version to tinymce URLs (tinymce is not updated very often). Wouldn't it be better to have tinymce version in URL ? Like /intranet-tmpl/lib/tinymce/5.0.16/jquery.tinymce.min.js ? If I understood correctly that should also fix the issue.
(In reply to Julian Maurice from comment #6) > I cannot test with IE, but I confirm that it is still working with Firefox. > > However, it doesn't make much sense to append koha version to tinymce URLs > (tinymce is not updated very often). Wouldn't it be better to have tinymce > version in URL ? Like > /intranet-tmpl/lib/tinymce/5.0.16/jquery.tinymce.min.js ? > > If I understood correctly that should also fix the issue. I wrote an alternative patch here : https://gitlab.com/jajm/Koha/-/tree/bug/25697-alt (commit https://gitlab.com/jajm/Koha/-/commit/d2ac23957522dac45a5971b9eb4435954c609d2b)
Created attachment 106362 [details] [review] Bug 25697: Declare base url and suffix in tinymce init This patch declares the base url and suffix in tinymce init, so that tinymce will initialize properly cross-browser. Without this change, tinymce will fail to initialize on IE 11. Test plan: 0. Apply patch 1. Open IE 11 2. Enable "UseWYSIWYGinSystemPreferences" system preference 3. Go to /cgi-bin/koha/admin/preferences.pl?tab=opac and note that tinymce initializes correctly 4. Go to /cgi-bin/koha/tools/koha-news.pl and create/edit a news item, and note that tinymce initializes correctly 5. Go to /cgi-bin/koha/admin/branches.pl and add/edit a library, and note that tinymce initializes correctly for "OPAC info" Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Sorry Julian, I saw your comments too late. You change is the bigger one and I am not sure why we had settled on appending the version in the file name - but maybe it would make sense to use the same method everywhere? Adding Owen and hoping that David will be able to tell us if your patch works with IE (I couldn't test that either)
Owen, could you maybe have a look at David's patch and Julian's alternative?
(In reply to Katrin Fischer from comment #9) > Adding Owen and hoping that David will be able to tell us if your patch > works with IE (I couldn't test that either) I haven't tried the patch yet, but it sounds reasonable to me.
Actually, in a different patch, I think I said I'm now advocating that all IE 11 users use Edge instead, so I wouldn't mind us closing this as a WONTFIX.
We have been discussing IE support at the last general meeting and we will add a note that IE is not supported for the staff interface to the manual and to use Edge based browsers instead: https://meetings.koha-community.org/2020/general_irc_meeting_15_july_2020.2020-07-15-20.03.log.html