From a2de6c00a00940a0edc76c32f4400f689141f54f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Jul 2021 12:26:21 +0200 Subject: [PATCH 1/4] Prepare 13.0.4 --- ChangeLog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index d3cc6da9b9c..281c8733ce6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,27 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 13.0.4 compared to 13.0.2 ***** + +FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules). +FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()` +FIX: #17919 pictures in docs. +FIX: #18006 +FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding +FIX: Accoutancy Limit date payment not registered on purchases operations +FIX: Can't edit replacement invoice +FIX: deposit can create credit note in payment conf +FIX: division by zero on create +FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field +FIX: holiday: status filter parameter has been renamed but not in links it was used +FIX: List and Create Companies Left Menus +FIX: method exists +FIX: need to add payment sum to getlibstatus function in object linked block +FIX: permission to close a proposal when using advanced permissions +FIX: Problem of z-index with popup and top menu +FIX: same thing on supplier orders +FIX: Status of invoice when making a replacement invoice +FIX: update contact birthday alert ***** ChangeLog for 13.0.3 compared to 13.0.2 ***** From d3f324c2d4267ab27c7cc127d238f8b563891889 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Jul 2021 16:55:16 +0200 Subject: [PATCH 2/4] Try a better fix for #18105 --- htdocs/core/class/hookmanager.class.php | 23 ++++++++++++++++++----- htdocs/core/lib/functions.lib.php | 7 ++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index d610203b3ad..8384886e50c 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -254,16 +254,29 @@ class HookManager // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { - $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) - if ($resaction < 0 || !empty($actionclassinstance->error) || (!empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) - { + $resactiontmp = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) + $resaction += $resactiontmp; + + if ($resactiontmp < 0 || !empty($actionclassinstance->error) || (!empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) { $error++; $this->error = $actionclassinstance->error; $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors); dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error) ? '' : " ".$this->error).(empty($this->errors) ? '' : " ".join(",", $this->errors)), LOG_ERR); } - if (isset($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray = array_merge($this->resArray, $actionclassinstance->results); - if (!empty($actionclassinstance->resprints)) $this->resPrint .= $actionclassinstance->resprints; + if (isset($actionclassinstance->results) && is_array($actionclassinstance->results)) { + if ($resactiontmp > 0) { + $this->resArray = $actionclassinstance->results; + } else { + $this->resArray = array_merge($this->resArray, $actionclassinstance->results); + } + } + if (!empty($actionclassinstance->resprints)) { + if ($resactiontmp > 0) { + $this->resPrint = $actionclassinstance->resprints; + } else { + $this->resPrint .= $actionclassinstance->resprints; + } + } } // Generic hooks that return a string or array (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...) else { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 884b5ece6f7..54ef73f19d6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7754,11 +7754,12 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, { $parameters = array('object' => $object, 'mode' => $mode, 'head' => $head); $reshook = $hookmanager->executeHooks('completeTabsHead', $parameters); - if ($reshook > 0) - { + if ($reshook > 0) { // Hook ask to replace completely the array $head = $hookmanager->resArray; - $h = count($head); + } else { // Hook + $head = array_merge($head, $hookmanager->resArray); } + $h = count($head); } } From df3d88570c4527f7da70d526a77154f86c567324 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Jul 2021 11:39:08 +0200 Subject: [PATCH 3/4] Fix missing column in migration --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index da4d0fd0a42..cb466f94b10 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -368,7 +368,7 @@ ALTER TABLE llx_actioncomm_reminder ADD UNIQUE uk_actioncomm_reminder_unique (fk ALTER TABLE llx_actioncomm_reminder ADD INDEX idx_actioncomm_reminder_status (status); - +ALTER TABLE llx_inventorydet ADD COLUMN fk_warehouse integer DEFAULT 0; ALTER TABLE llx_inventorydet ADD UNIQUE uk_inventorydet(fk_inventory, fk_warehouse, fk_product, batch); ALTER TABLE llx_commandedet ADD COLUMN ref_ext varchar(255) AFTER label; From 7a589921fe3d6cd902bff136b5047d8811bd80ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Jul 2021 13:10:19 +0200 Subject: [PATCH 4/4] Fix #18142 --- htdocs/install/mysql/tables/llx_facture.sql | 2 +- htdocs/install/mysql/tables/llx_facture_fourn.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 010cf1c1573..ee98752e5f3 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -86,7 +86,7 @@ create table llx_facture fk_incoterms integer, -- for incoterms location_incoterms varchar(255), -- for incoterms - fk_mode_transport integer, -- for intracomm report + fk_transport_mode integer, -- for intracomm report situation_cycle_ref smallint, -- situation cycle reference situation_counter smallint, -- situation counter diff --git a/htdocs/install/mysql/tables/llx_facture_fourn.sql b/htdocs/install/mysql/tables/llx_facture_fourn.sql index ef7e980b8aa..906125d0679 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn.sql @@ -71,7 +71,7 @@ create table llx_facture_fourn fk_incoterms integer, -- for incoterms location_incoterms varchar(255), -- for incoterms - fk_mode_transport integer, -- for intracomm report + fk_transport_mode integer, -- for intracomm report model_pdf varchar(255), last_main_doc varchar(255), -- relative filepath+filename of last main generated document