01471: include once with pagetoc and sourceblock causes blank screen on 2.2.142-php8.0
Description: In config.php, only include_once spellchecker is working. Both pagetoc and sourceblock cause the following:
2021-10-01 12:44:30: mod_fastcgi.c.487) FastCGI-stderr: thrown in /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php on line 504 2021-10-01 12:44:45: mod_fastcgi.c.487) FastCGI-stderr:PHP Fatal error: Uncaught Error: Call to undefined function create_function() in /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php:504 2021-10-01 12:44:45: mod_fastcgi.c.487) FastCGI-stderr:Stack trace: 2021-10-01 12:44:45: mod_fastcgi.c.487) FastCGI-stderr:#0 /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php(1879): PCCF() 2021-10-01 12:44:45: mod_fastcgi.c.487) FastCGI-stderr:#1 /var/www/localhost/htdocs/pmwiki-2.2.142/cookbook/pagetoc.php(63): Markup_e()
2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:PHP Fatal error: Uncaught Error: Call to undefined function create_function() in /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php:504 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:Stack trace: 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:#0 /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php(1879): PCCF() 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:#1 /var/www/localhost/htdocs/pmwiki-2.2.142/cookbook/sourceblock.php(40): Markup_e() 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:#2 /var/www/localhost/htdocs/pmwiki-2.2.142/local/config.php(33): include_once('...') 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:#3 /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php(351): include_once('...') 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:#4 /var/www/localhost/htdocs/index.php(1): include_once('...') 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr:#5 {main} 2021-10-01 12:16:12: mod_fastcgi.c.487) FastCGI-stderr: thrown in /var/www/localhost/htdocs/pmwiki-2.2.142/pmwiki.php on line 504
Both are working with php-8 in 2.2.139 of pmwiki.
bob sanders? October 01, 2021, at 08:07 PM
Since there are no major changes between 2.2.139 and 2.2.142, I suspect it doesn't work with 2.2.139 either. While these errors are caused by recipes that should be updated and maintained, maybe the core should handle these more gracefully. The apparent agreement in the community has been that it is better to get the wiki with obsolete customizations to break at the moment the administrator is doing the upgrade, rather than silently hiding/ignoring the errors, and the administrator failing to notice some markup is not working on some page. Like a quick pull of a bandage.
Could we handle this differently? What could we do if local customizations are using obsolete code? For example Markup rules, we can keep the existing markup in the page without processing it, or we can print some error message in its place to help tracking the cause. Or we can just show a blank error message with Abort() without actually causing PHP to crash.
I think this could and should be improved. --Petko October 02, 2021, at 06:20 AM
I have released version 2.2.143 which should disable most incompatible markup rules instead of crashing the PHP interpreter. --Petko October 02, 2021, at 08:39 AM
About the obsolete recipes, I suggest you try to contact their maintainers via email. Alternatively, the PmWiki core has similar functionality that should be supported for the foreseeable future. See PmWiki.Table of contents and PmWiki.WikiStyles#highlight if one or both of them could suit you. --Petko October 02, 2021, at 02:42 PM