From b90815b972eff2168203148421e27e4b638fdef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= <613615+jtraulle@users.noreply.github.com> Date: Tue, 13 Aug 2019 16:36:41 +0200 Subject: [PATCH 1/5] FIX require product class (fixes POST /supplierinvoices REST API endpoint) When passing a fk_product field into a supplier invoice line on the POST /supplierinvoices REST API endpoint, we need to require the product class first in fournisseur.facture.class.php to be able to load the Product from the passed id. --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 41ac2f126a7..132fcbc9e47 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -36,6 +36,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** * Class to manage suppliers invoices From e3bca063a004851de5bf93094aa07a9335d1f5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= <613615+jtraulle@users.noreply.github.com> Date: Tue, 13 Aug 2019 17:06:46 +0200 Subject: [PATCH 2/5] Fix CI code style checks Not my fault but I am disciplined so, if the CI says it is an error ... I just fix it to get green again ;) --- htdocs/core/lib/website.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 4d89210cd44..579c5575988 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -33,7 +33,7 @@ * @return boolean True if OK * @see dolWebsiteOutput() for function used to replace content in a web server context */ -function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $contenttype='html') +function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $contenttype = 'html') { $nbrep = 0; @@ -187,7 +187,7 @@ function dolKeepOnlyPhpCode($str) * @return void * @see dolWebsiteReplacementOfLinks() for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on */ -function dolWebsiteOutput($content, $contenttype='html', $containerid='') +function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') { global $db, $langs, $conf, $user; global $dolibarr_main_url_root, $dolibarr_main_data_root; From 107e6be6d93ad7afe729079c64ef7b47fa9c17aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= <613615+jtraulle@users.noreply.github.com> Date: Thu, 15 Aug 2019 15:40:55 +0200 Subject: [PATCH 3/5] Fix code style issue. --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 716cf891084..456580124d8 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -34,7 +34,7 @@ * @return boolean True if OK * @see dolWebsiteOutput() for function used to replace content in a web server context */ -function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $contenttype='html', $containerid='') +function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $contenttype = 'html', $containerid = '') { $nbrep = 0; From a66560ee935cf97e3e6cbd82db811da9ffd88685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= <613615+jtraulle@users.noreply.github.com> Date: Thu, 15 Aug 2019 16:22:02 +0200 Subject: [PATCH 4/5] Update ruleset.xml --- dev/setup/codesniffer/ruleset.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index daf73e5b2a7..89ea98a051b 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -6,6 +6,7 @@ build/html build/aps documents + htdocs/core/class/lessc.class.php htdocs/custom htdocs/includes htdocs/install/doctemplates/websites From fd8cbd9a938ac7e3882fd59392c35de183c3c1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= <613615+jtraulle@users.noreply.github.com> Date: Thu, 15 Aug 2019 16:23:01 +0200 Subject: [PATCH 5/5] Update files.lib.php --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 79b0badf0ff..a5bbd68a736 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1911,7 +1911,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") dol_syslog("Class ZipArchive is set so we zip using ZipArchive to zip into ".$outputfile.' rootPath='.$rootPath); $zip = new ZipArchive; - if ($zip->open($outputfile, ZipArchive::CREATE)!==TRUE) { + if ($zip->open($outputfile, ZipArchive::CREATE)!==true) { $errormsg="Failed to open file ".$outputfile."\n"; dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); return -6;