diff --git a/htdocs/ecm/ecmdirectory.class.php b/htdocs/ecm/ecmdirectory.class.php index 544d433064f..f6577e13fb1 100644 --- a/htdocs/ecm/ecmdirectory.class.php +++ b/htdocs/ecm/ecmdirectory.class.php @@ -545,9 +545,9 @@ class EcmDirectory // extends CommonObject } /** - * \brief refresh cachenboffile + * \brief Refresh value for cachenboffile * \param directory Directory to scan - * \return int <0 if ko, >0 if OK + * \return int <0 if KO, Nb of files in directory if OK */ function refreshcachenboffile() { @@ -569,7 +569,7 @@ class EcmDirectory // extends CommonObject if ($resql) { $this->cachenbofdoc=sizeof($filelist); - return 1; + return $this->cachenbofdoc; } else { diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index d8cb74813b4..923740ae735 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -277,9 +277,10 @@ foreach($rub as $key => $val) if ($_GET['action'] == 'refreshauto') { $result=$ecmdirstatic->fetch($val['id']); - $result=$ecmdirstatic->refreshcachenboffile(); - $ecmdirstatic->ref=$ecmdirstatic->label; + + $result=$ecmdirstatic->refreshcachenboffile(); + $val['cachenbofdoc']=$result; }