diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index fc01474a072..173d8520423 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -468,16 +468,17 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, { //print 'modulepart='.$modulepart.' fullpathselecteddir='.$fullpathselecteddir.' - val[fullrelativename] (in database)='.$val['fullrelativename'].' - val[id]='.$val['id'].' - is_dir='.dol_is_dir($fullpathselecteddir . $file).' - file='.$file."\n"; $newselecteddir = $val['fullrelativename']; + $newfullpathselecteddir=''; if ($modulepart == 'ecm') { $newfullpathselecteddir=$conf->ecm->dir_output.'/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : ''); } - if ($modulepart == 'medias') + elseif ($modulepart == 'medias') { $newfullpathselecteddir=$dolibarr_main_data_root.'/medias/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : ''); } - treeOutputForAbsoluteDir($sqltree, $newselecteddir, $newfullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth+1); + if ($newfullpathselecteddir) treeOutputForAbsoluteDir($sqltree, $newselecteddir, $newfullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth+1); } print "\n"; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 17ada096fd1..1ca10d9dd9b 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -126,7 +126,7 @@ class Menubase $this->perms=trim($this->perms); $this->enabled=trim($this->enabled); $this->user=trim($this->user); - $this->position=trim($this->position); + if (empty($this->position)) $this->position=0; if (! $this->level) $this->level=0; // Check parameters