diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bd3cf69c86a..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(); } } diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 99916b8ed70..a541dfab700 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,11 @@ class FormResource $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 3) { $value = $arraytypes['code']; - } elseif (empty($value)) { - print ' '; } + if (empty($value)) { + $value = ' '; + } + print $value; print ''; } }