lpaulsen93 / dokuwiki-plugin-odt

Exports a page to the Open Document format used by OpenOffice.org and other word processors
http://www.dokuwiki.org/plugin:odt
13 stars 26 forks source link

Invalid argument supplied for foreach() in [...] lib/plugins/odt/ODT/css/cssimportnew.php on line 1263 #288

Closed fjf2002 closed 1 year ago

fjf2002 commented 1 year ago

Hello,

I'm getting the following errors in apache's error.log. I'm using PHP 7.2 and the latest dokuwiki.

Invalid argument supplied for foreach() in [...] lib/plugins/odt/ODT/css/cssimportnew.php on line 1263

fjf2002 commented 1 year ago

Investigating the problem:

$properties = $parent->getProperties();

$parent->getProperties() seems to return NULL. What about

$properties = $parent->getProperties() ?? [];`
Stikus commented 1 year ago

Same problem here:

[root@wiki php-fpm]# grep -c 'Invalid argument supplied for foreach()' www-error.log
16480
[root@wiki php-fpm]# wc -l www-error.log
16565 www-error.log

Btw, proposed fix already in master but not in release: https://github.com/lpaulsen93/dokuwiki-plugin-odt/blob/master/ODT/css/cssimportnew.php#L1263

        foreach ($parents as $parent) {
            $properties = $parent->getProperties() ?? [];
            foreach ($properties as $key => $value) {
Stikus commented 1 year ago

@Klap-in Hello, can you release some latest fixes or this plugin is looking for maintainer?

Klap-in commented 1 year ago

I released ~that~ a new version. No idea why @lpaulsen93 is not involved anymore here, but maintainers are welcome!

Stikus commented 1 year ago

Unfortunately these fixes happened at the beginning of the March, but release happened at the end of February so they are not included.

Klap-in commented 1 year ago

Sorry for the unhandy formulation, I mean I released a new version. Please see https://github.com/lpaulsen93/dokuwiki-plugin-odt/releases

Stikus commented 1 year ago

I should first check for new release, sorry. Thanks for it!

Can confirm that issue is fixed for me. Maybe it should be closed?

Klap-in commented 1 year ago

Thanks for the feedback.