turnermm / ckgedit

CKEditor integrated into Dokuwiki
https://www.dokuwiki.org/plugin:ckgedit
GNU General Public License v2.0
59 stars 50 forks source link

Problem with PHP8 #673

Closed Juergen-aus-Zuendorf closed 1 year ago

Juergen-aus-Zuendorf commented 2 years ago

Hi,

after updating the dokuwiki server to PHP8 the ckgedit plugin fails with the following error message when I go to the konfig page of the admin console:

dokuwiki\Exception\FatalException: Declaration of renderer_plugin_ckgedit::header($text, $level, $pos) must be compatible with Doku_Renderer_xhtml::header($text, $level, $pos, $returnonly = false)
An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the ckgedit plugin.

What can I do?

Best regards Juergen

turnermm commented 2 years ago

See if this works for you: https://github.com/turnermm/ckgedit/archive/refs/heads/php8.zip

Unfortunately, I don't have php8 installed for testing. But this hopefully will work.

turnermm commented 2 years ago

@Juergen-aus-Zuendorf Have you tried the fix?

Juergen-aus-Zuendorf commented 2 years ago

Unfortunately, I did not have access to the test server yesterday.

So here is the test result from today. Unfortunately, an error message appears again:

dokuwiki\Exception\FatalException: Declaration of renderer_plugin_ckgedit::header($text, $level, $pos) must be compatible with Doku_Renderer_xhtml::header($text, $level, $pos, $returnonly = false)
An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the ckgedit plugin.

And here is the excerpt from the log file:

2022-07-06 06:37:41
dokuwiki\Exception\FatalException: Declaration of renderer_plugin_ckgedit::header($text, $level, $pos) must be compatible with Doku_Renderer_xhtml::header($text, $level, $pos, $returnonly = false)
/var/www/html/wiki/lib/plugins/ckgedit/renderer.php(68)
#0 [internal function]: dokuwiki\ErrorHandler::fatalShutdown()
#1 {main}
turnermm commented 2 years ago

Check line 68 of renderer.php. If it doesn't have the returnonly Parameter then there was an error in the installation of the php8 branch.

Juergen-aus-Zuendorf commented 2 years ago

The code on line 68 is function header($text, $level, $pos, $returnonly = false) What shall I do now?

shawnblues commented 2 years ago

Hi,I'm having the same problem as you, but I've solved it. Just replace $text, $level, $poswith $text, $level, $pos, $returnonly = false. You can huave a try.

Juergen-aus-Zuendorf commented 2 years ago

Thank you, now it works !

JorgeCarousel commented 1 year ago

I got this error today, even after downloading the latest from github.

dokuwiki\Exception\FatalException: Declaration of renderer_plugin_ckgedit::header($text, $level, $pos) must be compatible with Doku_Renderer_xhtml::header($text, $level, $pos, $returnonly = false) D:\Apache24\htdocs\dokuwiki\lib\plugins\ckgedit\renderer.php(68)

JorgeCarousel commented 1 year ago

See if this works for you: https://github.com/turnermm/ckgedit/archive/refs/heads/php8.zip

Unfortunately, I don't have php8 installed for testing. But this hopefully will work.

This worked for me, but it's time to switch to PHP 8, as per this: https://www.php.net/supported-versions.php PHP 7 will reach EOL in a couple of months.

turnermm commented 1 year ago

commit 8df8f21bd33c1101246718d34188b97e427f883c

This was fixed in the above commit. Make sure you have the “current” branch, not the master. Ckgedit has been been tested against php 7.4 and 8.x

JorgeCarousel commented 1 year ago

Gotcha, Current, not master.

turnermm commented 1 year ago

Is there a reason why you don't use the extension manager?

JorgeCarousel commented 1 year ago

I did, until it stopped showing me there were updates available.

turnermm commented 1 year ago

Sometimes it could be that I hadn't gotten around to updating the plugin page or the version date in the plugin.txt file. You can always see the most recent commits on the plugin page and use the reinstall button in the extension manager for the latest version.

JorgeCarousel commented 1 year ago

I deleted the previous folder, put in the "current" I downloaded and hit re-install, let's see how it goes.