• Resolved paolo1992

    (@paolo1992)


    The following error me to:

    Warning: Invalid argument supplied for foreach() in /home/ccchso5/public_html/wp-content/plugins/popup-builder/com/classes/components/Menu.php on line 157

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • clickingclients

    (@clickingclients)

    I have the same issue on update to Version 3.77.
    It errors when foreach is trying to access empty array on line 157.
    Please add the check and update the code soon:
    if(!empty($menuItems)){

    public function getNavMenuItemsWithPopup($navMenuLocations = array(), $forceUpdate = false)
        {
    		if (!isset(self::$navMenuItems) && !$forceUpdate) {
    			foreach ($navMenuLocations as $menuName => $menuId) {
    				$menuItems = wp_get_nav_menu_items($menuId);
    				if(!empty($menuItems)){
    					foreach ($menuItems as $menuItem) {
    						$popupId = $menuItem->sgpbPopupId;
    						if ($popupId > 0) {
    							self::$navMenuItems[] = $menuItem;
    						}
    					}
    				}
    			}
    		}
    
    		return isset(self::$navMenuItems) ? self::$navMenuItems : array();
    	}
    Andy Galaxy

    (@andy-galaxy)

    I’m getting the following PHP error as well.

    Warning: Invalid argument supplied for foreach() in /home/ccchso5/public_html/wp-content/plugins/popup-builder/com/classes/components/Menu.php on line 157

    Popup Builder v 3.77

    twistedfngrs

    (@twistedfngrs)

    Same issue, please fix this ASAP.

    birdsflyfree

    (@birdsflyfree)

    I have the same error:

    Warning: Invalid argument supplied for foreach() in /home/customer/www/stoodleighcourtcoachhouse.co.uk/public_html/wp-content/plugins/popup-builder/com/classes/components/Menu.php on line 157

    Please fix ASAP

    Sygnoos Support

    (@sygnoossupport)

    Dear @birdsflyfree , @twistedfngrs, @andy-galaxy, @clickingclients and @paolo1992

    Thanks for reporting.
    This is to inform you, that the issue is solved with the latest 3.78 version of the plugin.
    Please, update it and let us know if that helped.

    Andy Galaxy

    (@andy-galaxy)

    Well done! No error now. Thanks for prompt fix. Chers, Andy

    clickingclients

    (@clickingclients)

    Thanks for getting this done. Glad my code helped.

    birdsflyfree

    (@birdsflyfree)

    Fab! No error now! Thanks for your speedy response! ??

    Andy Galaxy

    (@andy-galaxy)

    Awesome plugin by the way. Keep up the good work.

    Sygnoos Support

    (@sygnoossupport)

    Thanks for the update ??
    We are happy the issue is gone now.
    Thanks for the nice words as well.
    We will keep improving the plugin.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP error 157’ is closed to new replies.