diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index f3b42a4789e..97f5eca5822 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1470,7 +1470,7 @@ class FormFile
print '
';
if ($useinecm == 1 || $useinecm == 5) { // ECM manual tree only
// $section is inside $param
- $newparam .= preg_replace('/&file=.*$/', '', $param); // We don't need param file=
+ $newparam = preg_replace('/&file=.*$/', '', $param); // We don't need param file=
$backtopage = DOL_URL_ROOT.'/ecm/index.php?§ion_dir='.urlencode($relativepath).$newparam;
print ''.img_edit('default', 0, 'class="paddingrightonly"').'';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 12e217c02e8..b17b837aa88 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -10045,7 +10045,7 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
- $dictvalues[$obj->{$rowidfield}] = $obj;
+ $dictvalues[$obj->{$rowidfield}] = $obj; // $obj is stdClass
}
} else {
dol_print_error($db);
@@ -10056,7 +10056,8 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
if (!empty($dictvalues[$id])) {
// Found
- return $dictvalues[$id]->{$field};
+ $tmp = $dictvalues[$id];
+ return (property_exists($tmp, $field) ? $tmp->$field : '');
} else {
// Not found
return '';
diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php
index 955e9dd479a..ddcb23da891 100644
--- a/htdocs/core/tpl/filemanager.tpl.php
+++ b/htdocs/core/tpl/filemanager.tpl.php
@@ -94,9 +94,11 @@ if ($permtoadd && GETPOSTISSET('website')) { // If on file manager to manage med
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '';
} elseif ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm
- print '';
- print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
- print '';
+ if (getDolGlobalInt('ECM_SHOW_GENERATE_WEBP_BUTTON')) {
+ print '';
+ print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
+ print '';
+ }
}
print " |