From 618afa5106f27c919a01ed0419e97720db2d4e8f Mon Sep 17 00:00:00 2001 From: Eric Rosas Date: Thu, 9 Jun 2022 16:49:09 -0700 Subject: [PATCH] Fixed bug that caused stack trace upon new callout EPO-6394 --- src/fields/DAMAsset.php | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/fields/DAMAsset.php b/src/fields/DAMAsset.php index 0dac513..2a46685 100644 --- a/src/fields/DAMAsset.php +++ b/src/fields/DAMAsset.php @@ -3,16 +3,13 @@ namespace rosas\dam\fields; use Craft; -// use craft\base\Field; use craft\fields\Assets as AssetField; use craft\base\ElementInterface; use craft\helpers\Json; use rosas\dam\controllers\AssetSyncController; use rosas\dam\db\AssetMetadata; use craft\gql\arguments\elements\Asset as AssetArguments; -//use craft\gql\interfaces\elements\Asset as AssetInterface; use rosas\dam\gql\interfaces\DAMAssetInterface as AssetInterface; -//use craft\gql\resolvers\elements\Asset as AssetResolver; use rosas\dam\gql\resolvers\DAMAssetResolver as AssetResolver; use craft\helpers\Gql as GqlHelper; use craft\services\Gql as GqlService; @@ -83,25 +80,13 @@ public function getInputHtml($value, ElementInterface $element = null): string { try { if($element->damAsset != null) { $assetId = $this->getDamAssetId($element->id); - - Craft::info("About to compare assetId", "UDAMI"); - Craft::info($assetId, "UDAMI"); - Craft::info(Json::encode($assetId), "UDAMI"); 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($assetId != [] && $assetId != "[]" && 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"); - Craft::info(Json::encode($metadata), "UDAMI"); $templateVals['assetId'] = $assetId; - } else { - Craft::info("did NOT pass second IF!!!", "UDAMI"); - } + } } - } } catch(Exception $e) { Craft::info($e, "error"); @@ -132,9 +117,6 @@ public static function getAssetMetadataByAssetId($assetId) { ->where(['"assetId"' => $assetId]) ->all(); - Craft::info("inside of getAssetMEtadataByAssetId", "UDAMI2"); - Craft::info(Json::encode($rows), "UDAMI2"); - $res = []; $currentId = 0; foreach($rows as $row) { @@ -148,9 +130,6 @@ public static function getAssetMetadataByAssetId($assetId) { } } } - - Craft::info("about to log res", "UDAMI2"); - Craft::info(Json::encode($res), "UDAMI2"); return $res; } }