NewsPublisher TinyMCE 5

@BobRay I’m not sure if this is specific to NewsPublisher or TinymceWrapper (or both) but apparently TinyMCE 4 is being retired soon and v5 will be required. As such I’m now getting an alert about the upgrade in both the Manager and front-end where I use Tiny.

The update is straightforward for a typical Tiny install (https://www.tiny.cloud/blog/how-to-migrate-from-tinymce-4-to-tinymce-5/) but as it applies to these two Extras I’m not sure where I need to make the changes.

Can you offer any insight?

Thanks.

Are you seeing the warnings in NewsPublisher itself?

NP loads Tiny 4 directly from the web, so in theory, all you’d have to do is add the new URL to the &tinysource property, which defaults to: //cdn.tinymce.com/4/tinymce.min.js

Putting this in the NP snippet tag might work. I don’t have time to test it right now. If you try it, let me know what happens.

&tinysource = `//cdn.tinymce.com/5/tinymce.min.js`   

There is a possibility that tiny 5 won’t play nice with NP or with elFinder.

[Update] There’s a new URL for Tiny 5 on this page and they want you to get a free API key, though I tried with the URL on the page and appeared to get the Tiny 5 code.

I have an API Key and added the domain to the approved list.

I tried your suggestion about &tinysource which was partially successful in removing the upgrade alert on the front-end.

However there is still one front-end Tiny field showing the alert. Looking at the page source I see the new cdn (and my API Key) is loading in the head (so far so good) but there’s still an instance of the old cdn <script type="text/javascript" src="//cdn.tinymce.com/4/tinymce.min.js"></script> at the bottom of the body and I can’t seem to locate where it’s coming from.

In the Manager the alert still appears so I’m not sure what’s going on there.

That’s weird. The only place that appears anywhere in NP’s code is in the line that grabs the value of tinysource. And it’s only used once – in the code that injects the part in the head.

I wonder if it could be in a template or chunk that being loaded on the page? I couldn’t find any code for injecting it (i.e., regClientScript) anywhere.

Do NP and elFinder actually work with Tiny 5?

I haven’t been able to determine yet if NP works w/ Tiny 5 because I can’t get Tiny 5 to load on the front-end, it’s still loading v4.

Also I use RFM, not elFinder (front and back) and can confirm that Tiny 5 breaks RFM functionality in the Manager.

To add to our misery, I see there are security vulnerabilities in Tiny 4.

It looks like a serious job to make NP and elFinder work with Tiny 5.

Hmmm… I fear the tools I depend on most will be the ones that can’t be fixed. I hope @donshakespeare can add some insight.

I replaced the URL in the newspublisher class file with this one:

//cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js

though you should be able to do it with the &tinysource property in the NP snippet tag.

I haven’t tested if fully, but it seems to work, and I was able to use the image browser to insert an image. If it doesn’t work with RFM, you may have to switch to elFinder.

Let me know what happens.

@bobray So far so good with Tiny 4.9.11 and RFM.

The Tiny interface/toolbar looks a bit different from how I had it configured previosly but everything seems to be working.

Thanks for the report. :slight_smile:

I replaced the URL in the newspublisher class file with this one:
//cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js work time
though you should be able to do it with the &tinysource property in the NP snippet tag.
I haven’t tested if fully, but it seems to work, and I was able to use the image browser to insert an image. If it doesn’t work with RFM, you may have to switch to elFinder.
Let me know what happens.

It works. Thank you

I’m glad that worked for you. Thanks for reporting back. :slight_smile: