Hi
I run across the error with SMARTY when inserting combined scripts in the footer
It only breaks when PHP 8 is enabled
{get_combined_scripts load='footer'}
uncaught typeerror: unsupported operand types: string - int in /include/template.class.php:1635 stack trace: #0
/include/template.class.php(842): scriptloader->get_footer_scripts() #1
...
if I look in exact location of the error in compiled tpl, I see the following code
<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['get_combined_scripts'][0], array( array('load'=>'footer'),$_smarty_tpl ) );?>
If I look in template.class.php @ line 1635 I see the following code
foreach( $todo as $id => $script)
{
$result[$script->load_mode-1][$id] = $script;
}
in PHP 8 $script->load_mode is "header" in first iteration
in PHP 7.4 it is indeed integer (1)
what would cause that?
Last edited by Serge D (2021-10-20 06:33:24)
Offline