Page 1 of 1

FlatPress 1.3.1 and PHP 8.4.0 beta 3

Posted: Fri Aug 16, 2024 7:05 am
by laborix
With the PHP 8.4.0 developer version there are some curiosities :roll: As with the alpha version, there are already skipped beta versions.

Test environment
Apache Server 2.4 with .htaccess option
Official PHP 8.4.0 beta 3 from August 15, 2024
FlatPress 1.3.1

The setup of FlatPress 1.3.1 runs without PHP and display problems, everything seems to fit here. The first frontend call brings the following errors in the php_errors.log:

Code: Select all

PHP Deprecated:  Smarty_Internal_Method_GetTemplateVars::getTemplateVars(): Implicitly marking parameter $_ptr as nullable is deprecated, the explicit nullable type must be used instead in .../fp131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_method_gettemplatevars.php on line 34
PHP Deprecated:  Smarty_Internal_Method_GetTemplateVars::_getVariable(): Implicitly marking parameter $_ptr as nullable is deprecated, the explicit nullable type must be used instead in .../fp131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_method_gettemplatevars.php on line 87
PHP Deprecated:  Smarty_Internal_TemplateCompilerBase::compileTemplate(): Implicitly marking parameter $parent_compiler as nullable is deprecated, the explicit nullable type must be used instead in .../fp131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 386
PHP Deprecated:  Smarty_Internal_TemplateCompilerBase::compileTemplateSource(): Implicitly marking parameter $parent_compiler as nullable is deprecated, the explicit nullable type must be used instead in .../fp131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 417
PHP Deprecated:  Smarty_Internal_Runtime_CodeFrame::create(): Implicitly marking parameter $compiler as nullable is deprecated, the explicit nullable type must be used instead in .../fp131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_runtime_codeframe.php on line 28
PHP Deprecated:  Smarty_Resource_Custom::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in .../fp131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_resource_custom.php on line 48
These errors are repeated when accessing the FlatPress login page. After the login also repetitions, but the backend area has no more CSS, only texts and background graphics?
You can still click through the complete admin area, but with the PHP deprecated Smarty errors.

Re: FlatPress 1.3.1 and PHP 8.4.0 beta 3

Posted: Fri Aug 16, 2024 4:04 pm
by laborix
Additional information.

I have tested also FlatPress 1.3.1 with the brand new Smarty Template Engine 4.5.4 (released Aug 14, 2024). Same situation, the PHP errors listed above.

Then I followed the starting points (see PHP Watch article),
https://php.watch/versions/8.4/implicit ... deprecated
unfortunately without success. There is also something to do with the SEO plugin :roll:

I have not tested anything with Smarty 5.4.0, as the following entry can be found in the Upgrading from an older version -
Upgrading from v4 to v5 document:
...
Removed PHP constants
The following constants have been removed to prevent global side effects.
SMARTY_DIR
...
see: https://smarty-php.github.io/smarty/stable/upgrading/

It looks like the step to PHP 8.4 will be a challenge ...

Re: FlatPress 1.3.1 and PHP 8.4.0 beta 3

Posted: Thu Aug 22, 2024 9:03 pm
by fraenkiman
Hello everyone,

Smarty 4 will not work without errors with PHP8.4.
It might make more sense to upgrade to Smarty 5 first, then take care of the PHP8.4 traps.
You can continue to use the constant SMARTY_DIR. I have installed Smatry 5.4.0 in the branch “upgrading-from-smarty-v4-to-v5” and created an autoloader in defaults.php at the end of the file. I was hoping to get FlatPress running without Mamespace. However, I only get a blank page.

I have previously changed the following (admin/main.php, contact.php, fp-includes/core/core.fpdb.class.php, fp-includes/core/core.system.php and fp-includes/core/core.theme.php):
Smarty API methods:
- $smarty->assignByRef() replaced with $smarty->assign()

Smarty API properties:
- $smarty->cache_dir replaced with $smarty->setCacheDir()
- $smarty->compile_dir replaced with $smarty->setCompileDir()
- $smarty->template_dir replaced with $smarty->setTemplateDir()

With best regards
Frank