diff --git a/.travis.yml b/.travis.yml index f5bd5f010f9..a5e26790005 100644 --- a/.travis.yml +++ b/.travis.yml @@ -374,7 +374,9 @@ script: - | echo "Upgrading Dolibarr" - # Ensure we catch errors. Set this to +e if you want to go to the end to see log files. + # Ensure we catch errors with -e. Set this to +e if you want to go to the end to see log files. + # Note: We keep +e because with pgsql, one of upgrade process fails even if migration seems ok, so + # I disable stop on error to be able to continue. set +e cd htdocs/install php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log @@ -470,7 +472,7 @@ script: phpunitresult=$? echo "Phpunit return code = $phpunitresult" set +e - + after_script: - | echo "After script - Output last lines of dolibarr.log" diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 6147b87b56b..66ab7201962 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -547,6 +547,17 @@ class Documents extends DolibarrApi } $upload_dir = $conf->contrat->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract'); + } elseif ($modulepart == 'projet' || $modulepart == 'project') { + $modulepart = 'project'; + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + + $object = new Project($this->db); + $result = $object->fetch($id, $ref); + if (!$result) { + throw new RestException(404, 'Project not found'); + } + + $upload_dir = $conf->projet->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project'); } else { throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); } @@ -676,7 +687,7 @@ class Documents extends DolibarrApi require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $object = new CommandeFournisseur($this->db); - } elseif ($modulepart == 'project') { + } elseif ($modulepart == 'projet' || $modulepart == 'project') { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $object = new Project($this->db); } elseif ($modulepart == 'task' || $modulepart == 'project_task') { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index cbbe6f61a8a..9211cd3f875 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -341,7 +341,7 @@ class DoliDBMysqli extends DoliDB $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) { + if (getDolGlobalInt('SYSLOG_LEVEL') < LOG_DEBUG) { dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously } dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);