Tagged: error
Hi guys,
I see this showing up in the backend in the Enfold left menu:
Warning: array_flip(): Can only flip STRING and INTEGER values! in /home/barcelq8/public_html/villaitaly.it/wp-content/themes/enfold/framework/php/class-htmlhelper.php on line 1571
I have no idea what it means and whether it can give an issue/how to fix it.
Can you help, please?
Thank you so much
Antonio
Hey Antonio,
Thanks for the screenshot and login details, though the login details don’t seem to work. Could you check and verify please?
Best regards,
Rikard
Hi,
Thanks for the info.
This should help: https://kriesi.at/support/topic/fehler-beim-update/#post-1024333
Best regards,
Ismael
Thanks Ismael,
the thread you posted is in German…while I understand German I’m not sure I found the solution, can you help?
Thanks
Hi,
Sorry about that. You need edit the enfold/framework/php/class-htmlhelper.php on line 1571
$menu_locations = array_flip( get_nav_menu_locations() );
Replace it with:
/**
* array_flip does not work because plugins like WPML might return '' or null for value which throws a warning
*
* $menu_locations = array_flip( get_nav_menu_locations() );
*/
$menu_locations = array();
$temp = get_nav_menu_locations();
foreach ( $temp as $loc => $term_id )
{
if( is_numeric( $term_id ) && ( $term_id > 0 ) )
{
$menu_locations[ $term_id ] = $loc;
}
}
Best regards,
Ismael
Thank you @Ismael,
I tried your solution but there seem to be an error at line 1578:
foreach ( $temp as $loc => $term_id )
Do you know what the correct line should be?
Thank you
Antonio