Skip to content

Commit

Permalink
Merge pull request #9 from lsst-epo/EPO-6394
Browse files Browse the repository at this point in the history
Epo 6394
  • Loading branch information
ericdrosas87 authored Jun 9, 2022
2 parents 53c19c7 + e42622b commit 0278ba4
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/fields/DAMAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,26 @@ public function getInputHtml($value, ElementInterface $element = null): string {
'value' => $value,
'fieldId' => $this->id,
'elementId' => $element->id,
'id' => $id,
'element' => Json::encode($element),
'id' => $id,
'element' => Json::encode($element),
'namespacedId' => $namespacedId,
];

try {
if($element->damAsset != null) {
$assetId = $this->getDamAssetId($element->id);
try {
if($element->damAsset != null) {
$assetId = $this->getDamAssetId($element->id);

if($assetId != null) {
$assetId = $assetId[0];
$metadata = $this->getAssetMetadataByAssetId($assetId);
if($metadata != null && count($metadata) > 0) {
$templateVals['assetId'] = $assetId;
if($assetId != null && $assetId != []) {
$assetId = $assetId[0];
$metadata = $this->getAssetMetadataByAssetId($assetId);
if($metadata != null && count($metadata) > 0) {
$templateVals['assetId'] = $assetId;
}
}
}
}
} catch(Exception $e) {
Craft::info($e, "error");
}
} catch(Exception $e) {
Craft::info($e, "error");
}

if(array_key_exists("thumbnailUrl", $metadata)) {
$templateVals['thumbnailUrl'] = $metadata["thumbnailUrl"];
Expand Down

0 comments on commit 0278ba4

Please sign in to comment.