Index: trunk/kernel/include/item.php =================================================================== diff -u -r1347 -r2734 --- trunk/kernel/include/item.php (.../item.php) (revision 1347) +++ trunk/kernel/include/item.php (.../item.php) (revision 2734) @@ -153,19 +153,19 @@ else { $this->CustomFields[$f->Get("FieldName")]['value'] = $f->HasField('Value') ? $f->Get('Value') : ''; - $this->CustomFields[$f->Get("FieldName")]['lang_value'] = ''; + $this->CustomFields[$f->Get("FieldName")]['lang_value'] = null; } } else { $this->CustomFields[$f->Get("FieldName")]['value'] = strlen($f->HasField('Value')) ? $f->Get('Value') : ''; - $this->CustomFields[$f->Get("FieldName")]['lang_value'] = ''; + $this->CustomFields[$f->Get("FieldName")]['lang_value'] = null; } } else { $this->CustomFields[$f->Get("FieldName")]['value'] = strlen($f->HasField('Value')) ? $f->Get('Value') : ''; - $this->CustomFields[$f->Get("FieldName")]['lang_value'] = ''; + $this->CustomFields[$f->Get("FieldName")]['lang_value'] = null; } } @@ -594,7 +594,11 @@ global $objSession, $objFavorites; $res = FALSE; - if($objSession->HasCatPermission("FAVORITES", $this->GetPrimaryCategory() )) + + // user can be added to favorites, but they have no primary category :) + $category_id = method_exists($this, 'GetPrimaryCategory') ? $this->GetPrimaryCategory() : $GLOBALS['m_var_list']['cat']; + + if( $objSession->HasCatPermission("FAVORITES", $category_id) ) { if(!$PortalUserId) $PortalUserId = $objSession->Get("PortalUserId"); @@ -613,7 +617,10 @@ $res = FALSE; - if($objSession->HasCatPermission("FAVORITES", $this->GetPrimaryCategory())) + // user can be added to favorites, but they have no primary category :) + $category_id = method_exists($this, 'GetPrimaryCategory') ? $this->GetPrimaryCategory() : $GLOBALS['m_var_list']['cat']; + + if( $objSession->HasCatPermission("FAVORITES", $category_id) ) { if(!$PortalUserId) $PortalUserId = $objSession->Get("PortalUserId");