diff --git a/sources/renderer/bootstrap/fieldrenderer/bsselectobjectfieldrenderer.class.inc.php b/sources/renderer/bootstrap/fieldrenderer/bsselectobjectfieldrenderer.class.inc.php index a12be3935..1784ce429 100644 --- a/sources/renderer/bootstrap/fieldrenderer/bsselectobjectfieldrenderer.class.inc.php +++ b/sources/renderer/bootstrap/fieldrenderer/bsselectobjectfieldrenderer.class.inc.php @@ -74,7 +74,9 @@ class BsSelectObjectFieldRenderer extends FieldRenderer $oSearch = $this->oField->GetSearch()->DeepClone(); $oCountSet = new DBObjectSet($oSearch); $iSetCount = $oCountSet->Count(); - $bRegularSelect = ($iSetCount <= $this->oField->GetMaximumComboLength()); + // Note : Autocomplete/Search is disabled for template fields as they are not external keys, thus they will just be displayed as regular select. + //$bRegularSelect = ($iSetCount <= $this->oField->GetMaximumComboLength()); + $bRegularSelect = ( ($iSetCount <= $this->oField->GetMaximumComboLength()) || ($this->oField->GetSearchEndpoint() === null) || ($this->oField->GetSearchEndpoint() === '') ); unset($oCountSet); // - For regular select @@ -135,9 +137,9 @@ EOF $sAutocompleteFieldId = 's_ac_' . $this->oField->GetGlobalId(); $sEndpoint = str_replace('-sMode-', 'autocomplete', $this->oField->GetSearchEndpoint()); $sNoResultText = Dict::S('Portal:Autocomplete:NoResult'); - + // Retrieving field value - if ($this->oField->GetCurrentValue() !== null && $this->oField->GetCurrentValue() !== 0) + if (($this->oField->GetCurrentValue() !== null) && ($this->oField->GetCurrentValue() !== 0) && ($this->oField->GetCurrentValue() !== '')) { try {