From 6cbcc54bd964eab272fd3e7f6ea63efc65dec6b5 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 12 Apr 2022 19:19:41 +0200 Subject: [PATCH 1/4] Fix: The resource dropdown does not show the values --- htdocs/resource/class/html.formresource.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 99916b8ed70..fa775bf5d58 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2019 Frédéric France + * Copyright (C) 2022 Ferran Marcet * * 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 @@ -224,9 +225,10 @@ class FormResource $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 3) { $value = $arraytypes['code']; - } elseif (empty($value)) { - print ' '; + } else { + $value = ' '; } + print $value; print ''; } } From ed172421f0bf1b425fb86227686dbcc633558d54 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 12 Apr 2022 19:20:45 +0200 Subject: [PATCH 2/4] Fix: The resource dropdown does not show the values --- htdocs/resource/class/html.formresource.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index fa775bf5d58..a541dfab700 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -225,7 +225,8 @@ class FormResource $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 3) { $value = $arraytypes['code']; - } else { + } + if (empty($value)) { $value = ' '; } print $value; From e9e10e84b2adb333e276f8dd5fce713b34ed87bb Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Wed, 13 Apr 2022 10:47:33 +0200 Subject: [PATCH 3/4] ensure priority in this usage ensure priority in this usage --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bd3cf69c86a..6fd09ed9723 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1690,7 +1690,7 @@ class Product extends CommonObject $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); foreach ($testExit as $field) { - if (!isset($this->$field[$level])) { + if (!isset($this->{$field}[$level])) { return array(); } } From 29242a23c36be39dfe7f76a21ae02aecce75165b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Apr 2022 12:11:35 +0200 Subject: [PATCH 4/4] Update product.class.php --- htdocs/product/class/product.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 6fd09ed9723..8ff89d8d086 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1690,7 +1690,11 @@ class Product extends CommonObject $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); foreach ($testExit as $field) { - if (!isset($this->{$field}[$level])) { + if (!isset($this->$field)) { + return array(); + } + $tmparray = $this->$field; + if (!isset($tmparray[$level])) { return array(); } }