(Retrofit from trunk) N°1123.2 AttributeImage: default_image is no longer mandatory.

SVN:2.4[5041]
This commit is contained in:
Guillaume Lajarige
2017-10-18 14:53:36 +00:00
parent 70561d6331
commit 9f4d07aaa5
3 changed files with 8 additions and 4 deletions

View File

@@ -5522,8 +5522,8 @@ class AttributeImage extends AttributeBlob
{
$iMaxWidthPx = $this->Get('display_max_width');
$iMaxHeightPx = $this->Get('display_max_height');
$sUrl = $this->GetOptional('default_image', '');
$sRet = '<img src="'.$sUrl.'" style="max-width: '.$iMaxWidthPx.'px; max-height: '.$iMaxHeightPx.'px">';
$sUrl = $this->Get('default_image');
$sRet = ($sUrl !== null) ? '<img src="'.$sUrl.'" style="max-width: '.$iMaxWidthPx.'px; max-height: '.$iMaxHeightPx.'px">' : '';
if (is_object($value) && !$value->IsEmpty())
{
if ($oHostObject->IsNew() || ($oHostObject->IsModified() && (array_key_exists($this->GetCode(), $oHostObject->ListChanges()))))