Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #129 from atrocore/fix-asset-attrs
Browse files Browse the repository at this point in the history
Fixed updating image attributes after upload file
  • Loading branch information
rratsun authored Jan 4, 2024
2 parents 56b84d5 + 74ad6cd commit fe72b0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Services/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ public function getTypeValue($type)
*/
public function getFileInfo(\Dam\Entities\Asset $asset)
{
$fileInfo = $this->getService("Attachment")->getFileInfo($asset->get("file"));
$attachment = $this->getEntityManager()->getEntity('Attachment', $asset->get('fileId'));

$fileInfo = $this->getService("Attachment")->getFileInfo($attachment);

$asset->set(
[
Expand All @@ -242,7 +244,7 @@ public function getFileInfo(\Dam\Entities\Asset $asset)
);

if ($this->isImage($asset)) {
$imageInfo = $this->getService("Attachment")->getImageInfo($asset->get("file"));
$imageInfo = $this->getService("Attachment")->getImageInfo($attachment);
$this->updateAttributes($asset, $imageInfo);
}
}
Expand Down

0 comments on commit fe72b0b

Please sign in to comment.