Github FlatPress 754 - First Test on PHP 8.1 - new Errors

For devs and testers: Tests of current development versions, technical details of the code.
Post Reply
Posts: 98
Joined: Sat Feb 16, 2019 3:51 pm

Github FlatPress 754 - First Test on PHP 8.1 - new Errors

Post by laborix » Tue Oct 11, 2022 4:03 pm

Quick&dirty Test Flatpress Github 754

Installation and changed to German all ok. Then first tests after registration, contributions and drafts :o

Code: Select all

PHP Warning:  Undefined array key "draft_list" in .../fpgit754/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^45b56d451334d455d19f37231165ec82f21d6616_0.admin.entrylist.php on line 46
PHP Warning:  Attempt to read property "value" on null in.../fpgit754/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^45b56d451334d455d19f37231165ec82f21d6616_0.admin.entrylist.php on line 46

Code: Select all

Line 46:
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['draft_list']->value, 'draft', false, 'draftid');
This only occurs when there are no drafts (complete new setup installation). After importing my old data with several "drafts" contributions, there were no further errors.
Further tests such as deleting, importing 400 posts from FlatPress 1.0.3 (built in 2015!) and recreating/rebuild PrettyUrls index, so far all ok. Then create static pages and next :shock:

Code: Select all

PHP Deprecated:  preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in .../fpgit754/fp-includes/core/core.wp-formatting.php on line 204
PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in .../fpgit754/fp-content/cache/2ea559ebb4cb14120f492e15f27d1a8f^9b6fecd64e7575fe857424b820cf2e81bd835901_0.admin.staticwrite.php on line 102

Code: Select all

Line 102:
<?php echo htmlspecialchars((($tmp = $_smarty_tpl->tpl_vars['content']->value ?? null)===null||$tmp==='' ? $_REQUEST['content'] ?? null : $tmp));?>
Otherwise, first impression, yes, FlatPress is slowly becoming usable under PHP 8.1 :D

User avatar
FlatPress Coder
Posts: 485
Joined: Sat Jan 26, 2019 7:40 pm

Re: Github FlatPress 754 - First Test on PHP 8.1 - new Errors

Post by Arvid » Tue Oct 11, 2022 6:13 pm

Thanks a lot, fixed it right away :)

We'll have to check all PHP warnings from the admin on the Responsive Admin branch again, though. But at least we know the general problem types already ... Smarty 4 an PHP 8.1 often stumble upon unintialized variables and incorrect parameter quotations.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests