N°1123.4 AttributeImage: Better UI when editing in console. Also, export was showing url for empty value.

SVN:trunk[5060]
This commit is contained in:
Guillaume Lajarige
2017-10-20 13:22:38 +00:00
parent b7c4e084f3
commit 5c34e3d988
5 changed files with 22 additions and 16 deletions

View File

@@ -5402,8 +5402,9 @@ class AttributeBlob extends AttributeDefinition
public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true, $bConvertToPlainText = false)
{
$sAttCode = $this->GetCode();
if ($sValue instanceof ormDocument)
if ($sValue instanceof ormDocument && !$sValue->IsEmpty())
{
IssueLog::Info(print_r($sValue, true));
return $sValue->GetDownloadURL(get_class($oHostObject), $oHostObject->GetKey(), $sAttCode);
}
return ''; // Not exportable in CSV !
@@ -5527,7 +5528,7 @@ class AttributeImage extends AttributeBlob
*/
public function CheckFormat($value)
{
if ($value instanceof ormDocument)
if ($value instanceof ormDocument && !$value->IsEmpty())
{
return ($value->GetMainMimeType() == 'image');
}