From bd0d9322139cc9536b7b5f16ba2331b82656134d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Jul 2022 18:37:55 +0200 Subject: [PATCH] Protection when a category has a parent that is category with other type --- htdocs/categories/class/categorie.class.php | 5 +++-- htdocs/societe/card.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index dad25199566..010d6da644f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1215,9 +1215,10 @@ class Categorie extends CommonObject while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) { //print '  cursor_categ='.$cursor_categ.' i='.$i.' '.$this->motherof[$cursor_categ].'
'."\n"; $this->cats[$id_categ]['fullpath'] = '_'.$this->motherof[$cursor_categ].$this->cats[$id_categ]['fullpath']; - $this->cats[$id_categ]['fulllabel'] = $this->cats[$this->motherof[$cursor_categ]]['label'].' >> '.$this->cats[$id_categ]['fulllabel']; + $this->cats[$id_categ]['fulllabel'] = (empty($this->cats[$this->motherof[$cursor_categ]]) ? 'NotFound' : $this->cats[$this->motherof[$cursor_categ]]['label']).' >> '.$this->cats[$id_categ]['fulllabel']; //print '  Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].' '.$this->cats[$id_categ]['fulllabel'].'
'."\n"; - $i++; $cursor_categ = $this->motherof[$cursor_categ]; + $i++; + $cursor_categ = $this->motherof[$cursor_categ]; } //print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'
'."\n"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 93540eb097c..ce53f60507a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2518,7 +2518,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; if ($maxmin > 0) { - $texte .= ''; // MAX_FILE_SIZE must precede the field type=file + print ''; // MAX_FILE_SIZE must precede the field type=file } print ''; print '';