Compare commits

...

1 Commits

Author SHA1 Message Date
Anne-Cath
f032710d7e N°9751 - Issue with AttributeImage in AttributeLinkedSetIndirect in the portal 2026-07-06 15:20:16 +02:00

View File

@@ -166,8 +166,10 @@ class AttributeImage extends AttributeBlob
return null;
}
$bExistingImageModified = ($oHostObject->IsModified() && (array_key_exists($this->GetCode(), $oHostObject->ListChanges())));
if ($oHostObject->IsNew() || ($bExistingImageModified)) {
if (is_null($oHostObject)
|| $oHostObject->IsNew()
|| ($oHostObject->IsModified() && array_key_exists($this->GetCode(), $oHostObject->ListChanges())) //$bExistingImageModified
) {
// If the object is modified (or not yet stored in the database) we must serve the content of the image directly inline
// otherwise (if we just give an URL) the browser will be given the wrong content... and may cache it
return 'data:'.$value->GetMimeType().';base64,'.base64_encode($value->GetData());