You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Can exists on template
if (Session::haveRight(self::$rightname, READ)) {
$nn = 0;
switch ($item->getType()) {
case 'Supplier' :
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = self::countForSupplier($item);
}
return self::createTabEntry(_n('Item', 'Items', Session::getPluralNumber()), $nb);
default :
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable('glpi_infocoms',
"`itemtype` = '".$item->getType()."'
AND `items_id` = '".$item->getID()."'");
}
return self::createTabEntry(__('Management'), $nb);
}
}
return '';
}
$nn variable is defined but doesn't seem to be used if "see counts in tabs" ('glpishow_count_on_tabs') is set to "no" $nb variable is not initialised and return self::createTabEntry(__('Management'), $nb);` is not correct.
i think code should be :
` /**
* @see CommonGLPI::getTabNameForItem()
**/
function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
// Can exists on template
if (Session::haveRight(self::$rightname, READ)) {
$nb = 0;
switch ($item->getType()) {
case 'Supplier' :
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = self::countForSupplier($item);
}
return self::createTabEntry(_n('Item', 'Items', Session::getPluralNumber()), $nb);
default :
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable('glpi_infocoms',
"`itemtype` = '".$item->getType()."'
AND `items_id` = '".$item->getID()."'");
}
return self::createTabEntry(__('Management'), $nb);
}
}
return '';
}
`
ladenree76000
changed the title
[0.90.5 BUG] PHP Notice: Undefined variable: nb in /var/www/glpi/inc/infocom.class.php at line 150
[0.90.5][9.1.1] BUG : PHP Notice: Undefined variable: nb in /var/www/glpi/inc/infocom.class.php at line 150
Jan 16, 2017
When "see counts in tab" is set to "no" , following message is displayed ( debug mode) when displaying assets :
PHP Notice: Undefined variable: nb in /var/www/glpi/inc/infocom.class.php at line 150
The text was updated successfully, but these errors were encountered: