diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 6ea7940d7a0..bbdc82b1b8b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4848,16 +4848,20 @@ function migrate_user_photospath() { while ($obj = $db->fetch_object($resql)) { + print '.'; + $fuser->fetch($obj->uid); //echo '
'.$fuser->id.' -> '.$fuser->entity; - $entity = (!empty($fuser->entity)) ? $fuser->entity : 1; + $entity = (empty($fuser->entity) ? 1 : $fuser->entity); if ($entity > 1) { $dir = DOL_DATA_ROOT . '/' . $entity . '/users'; } else { $dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module } + if ($dir) + { $origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user'); - $destin = $dir.'/'.$fuser->id; + $destin = $dir .'/'. $fuser->id; $error = 0; @@ -4895,6 +4899,7 @@ function migrate_user_photospath() } } } + } } }