Portal : Templates not working with OQL "list" fields. This only append when the field had too many items and was trying to render as an autocomplete.

SVN:trunk[4343]
This commit is contained in:
Guillaume Lajarige
2016-08-23 16:00:00 +00:00
parent df1d10f1cb
commit e6047dcbf5

View File

@@ -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,10 @@ EOF
$sAutocompleteFieldId = 's_ac_' . $this->oField->GetGlobalId();
$sEndpoint = str_replace('-sMode-', 'autocomplete', $this->oField->GetSearchEndpoint());
$sNoResultText = Dict::S('Portal:Autocomplete:NoResult');
\IssueLog::Info('== Field #' . $this->oField->GetId());
\IssueLog::Info(' |- Endpoint : ' . $sEndpoint);
// 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
{