Add protection against bad entries in llx_categorie_association

This commit is contained in:
Laurent Destailleur 2009-02-02 23:27:15 +00:00
parent d7ea79316d
commit 82a6fa058e

View File

@ -583,7 +583,7 @@ class Categorie
} }
/** /**
* \brief For category id_categ and its child available in this->cats, define property fullpath * \brief For category id_categ and its child available in this->cats, define property fullpath and fulllabel
* \param id_categ id_categ entry to update * \param id_categ id_categ entry to update
* \param protection Deep counter to avoid infinite loop * \param protection Deep counter to avoid infinite loop
*/ */
@ -591,7 +591,14 @@ class Categorie
{ {
dolibarr_syslog("Categorie::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG); dolibarr_syslog("Categorie::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
// Defini fullpath if (! empty($this->cats[$id_categ]['fullpath']))
{
// Already defined
dolibarr_syslog("Categorie::build_path_from_id_categ fullpath and fulllabel already defined", LOG_WARNING);
return;
}
// Define fullpath and fulllabel
if (isset($this->cats[$id_categ]['id_mere'])) if (isset($this->cats[$id_categ]['id_mere']))
{ {
$this->cats[$id_categ]['fullpath'] =$this->cats[$this->cats[$id_categ]['id_mere']]['fullpath']; $this->cats[$id_categ]['fullpath'] =$this->cats[$this->cats[$id_categ]['id_mere']]['fullpath'];