Merge pull request #5262 from atm-ph/fix_develop_fetch_extra_link

Fix using extrafield type "link to object" show error on edit card
This commit is contained in:
Laurent Destailleur 2016-06-03 23:18:24 +02:00
commit 4226396da4

View File

@ -1133,7 +1133,7 @@ class ExtraFields
if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
{
$object = new $InfoFieldList[0]($this->db);
$object->fetch($value);
if (!empty($value)) $object->fetch($value);
$valuetoshow=$object->ref;
if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ref is id because name is not unique
$out.='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="20" value="'.$valuetoshow.'" >';