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

PHP 8+ warnings, "undefined array key", margins lines 671-4 and 695 #272

Open
nerun opened this issue Sep 22, 2023 · 1 comment · May be fixed by #274
Open

PHP 8+ warnings, "undefined array key", margins lines 671-4 and 695 #272

nerun opened this issue Sep 22, 2023 · 1 comment · May be fixed by #274

Comments

@nerun
Copy link
Contributor

nerun commented Sep 22, 2023

PHP Warnings:

Undefined array key "margin-top" in .../lib/plugins/wrap/helper.php on line 671
Undefined array key "margin-right" in .../lib/plugins/wrap/helper.php on line 672
Undefined array key "margin-bottom" in .../lib/plugins/wrap/helper.php on line 673
Undefined array key "margin-left" in .../lib/plugins/wrap/helper.php on line 674
Undefined array key "float" in .../lib/plugins/wrap/helper.php on line 695

In helper.php (lines 671-4 and 695), I have changed these lines:

$margin_top = $css_properties ['margin-top'];
$margin_right = $css_properties ['margin-right'];
$margin_bottom = $css_properties ['margin-bottom'];
$margin_left = $css_properties ['margin-left'];
...
$frame_props ['float'] = $css_properties ['float'];

To:

$margin_top = $css_properties ['margin-top'] ?? null;
$margin_right = $css_properties ['margin-right'] ?? null;
$margin_bottom = $css_properties ['margin-bottom'] ?? null;
$margin_left = $css_properties ['margin-left'] ?? null;
...
$frame_props ['float'] = $css_properties ['float'] ?? null;

But i don't know if this really fix the issue, because these warnings doesn't happens frequently.

@nerun nerun changed the title PHP 8+ warnings, "undefined array key", margins lines 671-4 PHP 8+ warnings, "undefined array key", margins lines 671-4 and 695 Sep 22, 2023
@eduardomozart
Copy link
Contributor

eduardomozart commented Nov 28, 2023

I was able to reproduce the float warning and created the PR #274 to fix this issue. I tested it and it seems to be working as expected now.

eduardomozart added a commit to eduardomozart/dokuwiki_plugin_wrap that referenced this issue Nov 28, 2023
@eduardomozart eduardomozart linked a pull request Nov 28, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants