← Back to team overview

phpdevshell team mailing list archive

[Bug 418484] Re: Invalid argument supplied for foreach when installing menu-less plugin

 

** Changed in: phpdevshell/3.0.0
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of
PHPDevShell, which is subscribed to PHPDevShell.
https://bugs.launchpad.net/bugs/418484

Title:
  Invalid argument supplied for foreach when installing menu-less plugin

Status in Open Source php gui type development framework.:
  Fix Released
Status in PHPDevShell 3.0.0 series:
  Fix Released

Bug description:
  Installing a new plugin that contains no menu items produces the following error:


Warning: Invalid argument supplied for foreach() in /var/www/phpds28/plugins/PHPDevShell/includes/pluginmanager.class.php on line 241

This can easily be fixed by wrapping the foreach ($menus_array as $ranking => $menu) block on line 241 of pluginmanager.class.php with the following:

if (count($menus_array) > 0)
{
           // Insert new menu items into database.
          foreach ($menus_array as $ranking => $menu) {
}