From e505ebf0f72ccdf236c3ff037121aaa1e01cab07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Wed, 3 Apr 2024 15:03:16 +0200 Subject: [PATCH 1/7] FIX: categories protection limit --- htdocs/categories/class/categorie.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 063207be7d8cd..1461435ea71b5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2023 Frédéric France - * Copyright (C) 2023 Benjamin Falière + * Copyright (C) 2023-2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1180,6 +1180,8 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) $resql = $this->db->query($sql); if ($resql) { $i = 0; + $nbcateg = $this->db->num_rows($resql); + while ($obj = $this->db->fetch_object($resql)) { $this->cats[$obj->rowid]['rowid'] = $obj->rowid; $this->cats[$obj->rowid]['id'] = $obj->rowid; @@ -1201,7 +1203,7 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) dol_syslog(get_class($this)."::get_full_arbo call to buildPathFromId", LOG_DEBUG); foreach ($this->cats as $key => $val) { //print 'key='.$key.'
'."\n"; - $this->buildPathFromId($key, 0); // Process a branch from the root category key (this category has no parent) + $this->buildPathFromId($key, (!empty($nbcateg) ? $nbcateg : 0)); // Process a branch from the root category key (this category has no parent) } // Include or exclude leaf including $markafterid from tree From 2fbe1fe149e42e4ae6c4e3005b46ed0962747070 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2024 18:55:32 +0200 Subject: [PATCH 2/7] Update categorie.class.php --- htdocs/categories/class/categorie.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 1461435ea71b5..82dac135fda2c 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1159,7 +1159,8 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) } $this->cats = array(); - + $nbcateg = 0; + // Init this->motherof that is array(id_son=>id_parent, ...) $this->load_motherof(); $current_lang = $langs->getDefaultLang(); @@ -1203,7 +1204,7 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) dol_syslog(get_class($this)."::get_full_arbo call to buildPathFromId", LOG_DEBUG); foreach ($this->cats as $key => $val) { //print 'key='.$key.'
'."\n"; - $this->buildPathFromId($key, (!empty($nbcateg) ? $nbcateg : 0)); // Process a branch from the root category key (this category has no parent) + $this->buildPathFromId($key, $nbcateg); // Process a branch from the root category key (this category has no parent) } // Include or exclude leaf including $markafterid from tree From d32bb1668f8b6d9c8c3951352f868e91d357c469 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2024 18:58:10 +0200 Subject: [PATCH 3/7] Update categorie.class.php --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 82dac135fda2c..4430d835df4a5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1160,7 +1160,7 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) $this->cats = array(); $nbcateg = 0; - + // Init this->motherof that is array(id_son=>id_parent, ...) $this->load_motherof(); $current_lang = $langs->getDefaultLang(); From 660bb7bd5cf83798239df69f60b5ba043fda229b Mon Sep 17 00:00:00 2001 From: atm-irvine <165771178+atm-irvine@users.noreply.github.com> Date: Sat, 6 Apr 2024 13:30:28 +0200 Subject: [PATCH 4/7] FIX: Undefined array key default on fields (#29243) --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 754e3eceda31f..42934c3f9cac9 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -274,7 +274,7 @@ } $object->$key = $value; - if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { + if ($val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); } From bab1694cfcc2e6f2dd806bb8b00217c4d79dabb9 Mon Sep 17 00:00:00 2001 From: rqi14 Date: Sun, 7 Apr 2024 17:48:34 +0800 Subject: [PATCH 5/7] Fix bug in translation (zh-cn) (#29264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "由%s验证" is in correctly written as "由%验证s", causing failure in sprintf function in translate.class.php:743. [client 172.23.0.4:47410] PHP Fatal error: Uncaught ValueError: Unknown format specifie r "\xe9" in /var/www/html/core/class/translate.class.php:743\nStack trace:\n#0 /var/www/html/core/class/translate.class.php(743): sprintf()\n#1 /var/www/html/core/actions_massactions.inc.php(1638): Translate->transnoentitiesnoconv()\n#2 /var/www/html/holiday/list.php(221): include('... ')\n#3 {main}\n thrown in /var/www/html/core/class/translate.class.php on line 743 --- htdocs/langs/zh_CN/other.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/zh_CN/other.lang b/htdocs/langs/zh_CN/other.lang index cf686f5893319..268d88f3694e8 100644 --- a/htdocs/langs/zh_CN/other.lang +++ b/htdocs/langs/zh_CN/other.lang @@ -118,7 +118,7 @@ DemoCompanyManufacturing=Company manufacturing products DemoCompanyAll=公司有多项活动(所有主要模块) CreatedBy=创建者 %s ModifiedBy=修改者 %s -ValidatedBy=由%验证s +ValidatedBy=由%s验证 SignedBy=Signed by %s ClosedBy=由%闭s CreatedById=创建的用户ID号 From 01d82614b650e5115f8d10810aa86156a56b4f1c Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Sun, 7 Apr 2024 04:03:24 -0600 Subject: [PATCH 6/7] PHP warning on updating html type extrafield (#29260) FIX: #29229 --- htdocs/core/class/extrafields.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 237ac4fbd4141..af430118b51a5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -591,6 +591,7 @@ public function update($attrname, $label, $type, $length, $elementtype, $unique $lengthdb = '255'; } elseif ($type == 'html') { $typedb = 'text'; + $lengthdb = $length; } elseif ($type == 'link') { $typedb = 'int'; $lengthdb = '11'; From 330d20813ebd7c462f48a796293cd0efdde33740 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Apr 2024 02:54:01 +0200 Subject: [PATCH 7/7] Fix #29028 Fix #29163 Md-theme - Login is on other icons --- htdocs/main.inc.php | 15 +++++++-------- htdocs/theme/eldy/global.inc.php | 6 ++++++ htdocs/theme/md/dropdown.inc.php | 13 +++++++++---- htdocs/theme/md/style.css.php | 7 +++++++ 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 612f1000c12d7..1dd7a89a12ae8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2524,8 +2524,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '') if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { $btnUser = '