Customers portal : Improved error message on autocomplete field when the portal configuration is incorrect

SVN:trunk[4262]
This commit is contained in:
Guillaume Lajarige
2016-06-28 08:22:10 +00:00
parent 9d05c1c79c
commit 00d131e3fc

View File

@@ -19,7 +19,10 @@
namespace Combodo\iTop\Renderer\Bootstrap\FieldRenderer;
use \Exception;
use \CoreException;
use \utils;
use \IssueLog;
use \Dict;
use \UserRights;
use \InlineImage;
@@ -134,7 +137,15 @@ EOF
// Retrieving field value
if ($this->oField->GetCurrentValue() !== null && $this->oField->GetCurrentValue() !== 0)
{
$oFieldValue = MetaModel::GetObject($sFieldValueClass, $this->oField->GetCurrentValue());
try
{
$oFieldValue = MetaModel::GetObject($sFieldValueClass, $this->oField->GetCurrentValue());
}
catch (CoreException $e)
{
IssueLog::Error('Could not retrieve object ' . $sFieldValueClass . '::' . $this->oField->GetCurrentValue() . ' for "' . $this->oField->GetId() . '" field.');
throw new Exception($e->getMessage(), $e->getCode(), $e->getPrevious());
}
$sFieldValue = $oFieldValue->GetName();
}
else