Skip to content

Commit

Permalink
Merge pull request #13 from lsst-epo/EPO-6394
Browse files Browse the repository at this point in the history
Casting string to int then parsing as int
  • Loading branch information
ericdrosas87 authored Jun 9, 2022
2 parents 01a19cf + 74913be commit 8d0fbec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fields/DAMAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ public function getInputHtml($value, ElementInterface $element = null): string {
Craft::info("About to compare assetId", "UDAMI");
Craft::info($assetId, "UDAMI");
Craft::info(Json::encode($assetId), "UDAMI");
if($assetId != null && is_array($assetId)) {
if($assetId != null && is_array($assetId) && count($assetId) > 0) {
$assetId = $assetId[0];
Craft::info("about to log assetId inside of first IF", "UDAMI");
Craft::info($assetId, "UDAMI");
if(is_int($assetId)) {
if(is_int(intval($assetId))) { // value will likely come back as string, but may come back as "[]"
Craft::info("inside of the second IF!", "UDAMI");
$metadata = $this->getAssetMetadataByAssetId($assetId);
Craft::info("about to log metadata", "UDAMI");
Expand Down

0 comments on commit 8d0fbec

Please sign in to comment.