leibler / dokuwiki-plugin-todo

DokuWiki ToDo Plugin
39 stars 30 forks source link

PHP 8 Warning: argument must be of type array|object, null given #145

Closed arlt closed 1 year ago

arlt commented 2 years ago

It seems that the warning only occurs when I use both variants and the namespace does not exist- somewhat curious.

The following warning appears with the example and PHP 8.1.11:

[Thu Oct 13 12:04:28.006766 2022] [proxy_fcgi:error] [pid 30028] [client 127.0.0.1:47614] AH01071: Got error 'PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /var/www/dokuwiki/lib/plugins/todo/syntax/list.php on line 183'

... the other warnings from #143 remain.

Example code:

  * <todo start:YYYY-MM-DD due:YYYY-MM-DD>Text</todo>

~~TODOLIST ns:doesnotexist assigned:arlt~~

abcdef

Version information:

$ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
$ php --version
PHP 8.1.11 (cli) (built: Sep 28 2022 09:08:05) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.11, Copyright (c) Zend Technologies
$ cat dokuwiki/VERSION 
2022-07-31a "Igor"
$ grep date dokuwiki/lib/plugins/todo/plugin.info.txt 
date   2022-08-10