diff --git a/ChangeLog b/ChangeLog index f6fe916c13b..0df1c812d8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -144,6 +144,7 @@ Following changes may create regressions for some external modules, but were nec * Method getDictvalue has been renamed into getDictionaryValue to match camel case rule. * To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in method executeCLI() available into core/class/utils.class.php +* ExtraFields->showOutputField parameter 4 'extrafieldsobjectkey' is now required diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e73f83d1340..4eefdd4c6bc 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1488,7 +1488,7 @@ class ExtraFields * @param string $key Key of attribute * @param string $value Value to show * @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering) - * @param string $extrafieldsobjectkey If defined (for example $object->table_element), function uses the new method to get extrafields data + * @param string $extrafieldsobjectkey Required (for example $object->table_element). * @return string Formated value */ public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '') @@ -1510,11 +1510,9 @@ class ExtraFields $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) } else { - // Old usage - $label = $this->attribute_label[$key]; - $type = $this->attribute_type[$key]; - $help = ''; // Not supported with old syntax - $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + // Old usage not allowed anymore + dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_WARNING); + return ''; } if ($hidden) {