Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with PHP8 #673

Closed
Juergen-aus-Zuendorf opened this issue Jul 4, 2022 · 15 comments
Closed

Problem with PHP8 #673

Juergen-aus-Zuendorf opened this issue Jul 4, 2022 · 15 comments

Comments

@Juergen-aus-Zuendorf
Copy link
Contributor

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 added a commit that referenced this issue Jul 4, 2022
Make renderer::header comptible with Doku_Renderer_xhtml::header($text, $level, $pos, $returnonly = false)
@turnermm
Copy link
Owner

turnermm commented Jul 4, 2022

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
Copy link
Owner

turnermm commented Jul 5, 2022

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

@Juergen-aus-Zuendorf
Copy link
Contributor Author

Juergen-aus-Zuendorf commented Jul 6, 2022

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
Copy link
Owner

turnermm commented Jul 6, 2022

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
Copy link
Contributor Author

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

@shawnblues
Copy link

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

@Juergen-aus-Zuendorf
Copy link
Contributor Author

Thank you, now it works !

@JorgeCarousel
Copy link

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
Copy link

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
Copy link
Owner

turnermm commented Sep 21, 2022

commit 8df8f21

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
Copy link

Gotcha, Current, not master.

@turnermm
Copy link
Owner

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

@JorgeCarousel
Copy link

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

@turnermm
Copy link
Owner

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
Copy link

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

@turnermm turnermm closed this as completed Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants