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

Several "Undefined array key" warnings while editing pages #714

Open
KubilayC38 opened this issue Jun 7, 2024 · 1 comment
Open

Several "Undefined array key" warnings while editing pages #714

KubilayC38 opened this issue Jun 7, 2024 · 1 comment

Comments

@KubilayC38
Copy link

PHP: 8.2.8
DokuWiki: 2023-04-04a "Jack Jackrum"

After installing the newest version of the ckgedit plugin, I encounter the error messages

Warning: Undefined array key 1 in C:\inetpub\wwwroot\dokuwiki\lib\plugins\ckgedit\action\save.php on line 224

Warning: Undefined array key 1 in C:\inetpub\wwwroot\dokuwiki\lib\plugins\ckgedit\action\save.php on line 224

Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\wwwroot\dokuwiki\lib\plugins\ckgedit\action\save.php:224) in C:\inetpub\wwwroot\dokuwiki\inc\common.php on line 1840

after every save that involves a change of the page. If I edit and save a page without changing its content, no error occurs. These messages appear in a new blank screen. These errors also get shown if I want to change to the "DW Edit" mode.
Although these error messages appear, after a refresh or by going back a page it does what I want. But it does not seem to be right that it shows me these messages. And it only shows me these after the installation of this plugin. Before the installation, I was able to edit pages without problems. I get the errors with and without saving with a summary as I thought that this might be a cause.

Also, after getting in the "DW Edit" mode it shows me the errors

Warning: Undefined array key "fck_preview_mode" in C:\inetpub\wwwroot\dokuwiki\lib\plugins\ckgedit\action\meta.php on line 390

Warning: Undefined array key "fck_preview_mode" in C:\inetpub\wwwroot\dokuwiki\lib\plugins\ckgedit\action\meta.php on line 402

immediately as shown here:
image

Changing from "DW Edit" to "CKG Edit" works without showing an error.

Adding ?do=check on the page that I am testing on results in this output:

More than 32MB RAM (128 MB) available.
Changelog is writable
conf directory is writable
mb_string extension not available - PHP only replacements will be used
Your locale C seems not to be a UTF-8 locale, you should fix this if you encounter problems.
Debugging support is disabled
You are currently logged in as ***
You are part of the groups user
Your current permission for this page is 8
The current page is writable by the webserver
The current page is writable by you
The search index seems to be working
Server time seems to be okay. Diff: 0s

image

@achiles01
Copy link

workaround is to wrap variables in isset function.

e.g:
\lib\plugins\ckgedit\action\save.php on line 224

this:
if($link[1]) {

to this:
if(isset($link[1])) {

I edited it in a few places (save.php, admin.php, meta.php, mediamanager.php) and ckgedit works fine.

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

2 participants