From a8ca8c7a1f36df39c692e9b4cf58e96b1d47bdfb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Oct 2019 16:38:15 +0200 Subject: [PATCH] Fix edit of extrafields link when empty --- htdocs/core/class/extrafields.class.php | 1 + htdocs/core/tpl/extrafields_view.tpl.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f59aaab7bfa..271297b75e7 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2088,6 +2088,7 @@ class ExtraFields else { $value_key=GETPOST("options_".$key); + if (in_array($key_type, array('link')) && $value_key == '-1') $value_key = ''; } $object->array_options["options_".$key]=$value_key; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 6f52cbcab7a..f19cfff136e 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -85,6 +85,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] else { $value = $object->array_options["options_" . $key]; + //var_dump($key.' - '.$value); } if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') { @@ -178,7 +179,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] } else { - //print $key.'-'.$value.'-'.$object->table_element; + //var_dump($key.'-'.$value.'-'.$object->table_element); print $extrafields->showOutputField($key, $value, '', $object->table_element); }