Page 1 of 2

TinyMCE: Insert file does not work with php 8

Posted: Tue Jun 21, 2022 1:13 pm
by Callisto58
When I want to insert a file or image, only an empty window appears in the file upload window (insert file / filemanager).

Re: TinyMCE: Insert file does not work with php 8

Posted: Tue Jun 21, 2022 1:40 pm
by DIGI3
Looks like this has already been reported here: http://dev.cmsmadesimple.org/bug/view/12549

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 16, 2023 10:59 am
by antibart
DIGI3 wrote: Tue Jun 21, 2022 1:40 pm Looks like this has already been reported here: http://dev.cmsmadesimple.org/bug/view/12549
Yes, it is reported since june 2022 without any solution. The current version of TinyMCE is 6.3. The latest TinyMCE version in cmsms is 3.3.2., which is pretty old.

I have the same problem after changing to php 8.0..

In most cases I see an empty filemanager popup. But in one case I get an error report:

Fatal error: Uncaught ValueError: mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" in /homepages/5/xxx/htdocs/xxx/modules/TinyMCE/responsive_filemanager/filemanager/config/config.php:9 Stack trace: #0 /homepages/5/xxx/htdocs/xxx/modules/TinyMCE/responsive_filemanager/filemanager/config/config.php(9): mb_http_input('UTF-8') #1 /homepages/5/xxx/htdocs/xxx/modules/TinyMCE/responsive_filemanager/filemanager/dialog.php(4): include('/homepages/5/...') #2 {main} thrown in /homepages/5/xxx/htdocs/xxx/modules/TinyMCE/responsive_filemanager/filemanager/config/config.php on line 9.

There are some fixes
https://github.com/trippo/ResponsiveFil ... issues/673

... but finally it is not future-oriented to make a DIY-fix on a three years old version.

Re: TinyMCE: Insert file does not work with php 8

Posted: Wed Jan 18, 2023 11:10 am
by antibart
An update would be better, but this answer works for me

https://github.com/trippo/ResponsiveFil ... -936140658

In cmsms mb_http_input is line 9 in TinyMCE/responsive_filemanager/filemanager/config/config.php, not 49.

Re: TinyMCE: Insert file does not work with php 8

Posted: Wed Jan 18, 2023 3:32 pm
by DIGI3
An update would be most welcome. Unfortunately the developer passed away last year, and the other people on the project are no longer active. If anyone is willing to take it on they should get in touch with me or another Dev Team member.

Re: TinyMCE: Insert file does not work with php 8

Posted: Wed Jan 18, 2023 3:39 pm
by antibart
DIGI3 wrote: Wed Jan 18, 2023 3:32 pm Unfortunately the developer passed away last year
Oh. Sad news. :(

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 23, 2023 7:23 am
by jog
Sad news indeed.

I tried the above workaround and can't get it to work with PHP 8.0+ – could someone please post the modified files and/or the steps required?

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 23, 2023 7:59 am
by antibart
jog wrote: Mon Jan 23, 2023 7:23 am – could someone please post the modified files and/or the steps required?
With this modifications it works for me: http://dev.cmsmadesimple.org/bug/view/12549

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 23, 2023 8:50 am
by jog
Thank you very much! This fix works with PHP 8.1.13 on two separate installations.

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 23, 2023 3:01 pm
by DIGI3
Technically our forum rules do not allow posting of code changes, these need to go on the forge. Because support for this module has lapsed we will leave it up for a while, but please consider moving it to the forge then editing your post with a link to it.

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 23, 2023 3:13 pm
by antibart
DIGI3 wrote: Mon Jan 23, 2023 3:01 pm Technically our forum rules do not allow posting of code changes, these need to go on the forge. Because support for this module has lapsed we will leave it up for a while, but please consider moving it to the forge then editing your post with a link to it.
Sorry for that.

I can move the code modifications to the forge. But the time to edit my last post is over.

Here is the link to the forge:

http://dev.cmsmadesimple.org/bug/view/12549

Now anybody could delete my post.

---

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Jan 23, 2023 3:15 pm
by DIGI3
Thanks, all sorted!

Re: TinyMCE: Insert file does not work with php 8

Posted: Tue Jan 24, 2023 10:46 am
by Callisto58
Thanks antibart for the solution. works perfect!

Re: TinyMCE: Insert file does not work with php 8

Posted: Mon Oct 07, 2024 9:50 am
by funkyhead
Hi,

To complete this, after a problem of rights access at the end of uploads with php 8.3.12,
i have had in :

/modules/TinyMCE/responsive_filemanager/filemanager/UploadHandler.php

at line 1072 :

chmod($file_path, 0644);


to force good rights, just before : $fp = fopen($file_path, 'r');

and it's resolv the issue.

Good day and one again : great job for CMSMS's dev team. Thanks a lot.

Re: TinyMCE: Insert file does not work with php 8

Posted: Wed Oct 09, 2024 2:57 pm
by musicscore
If you are using TinyMCE with PHP 8.x then you have to change the filemanager config :

Open \modules\tinymce\responsive_filemanager\filemanager\config\config.php

Change Line 9 :

mb_http_input('UTF-8'); to mb_http_input();