•  » Beta testing
  •  » 12.0rc2 with PHP 8 and get_combined_scripts macro

#1 2021-10-20 06:32:07

Serge D
Member
US
2014-07-15
384

12.0rc2 with PHP 8 and get_combined_scripts macro

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

 
  •  » Beta testing
  •  » 12.0rc2 with PHP 8 and get_combined_scripts macro

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact