Skip to content

Commit

Permalink
Cleaned up code for merge/release
Browse files Browse the repository at this point in the history
EPO-7944
  • Loading branch information
ericdrosas87 committed Apr 20, 2023
1 parent 1ebdf95 commit 43cb1e1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Tech debt clean-up:
- PhpStorm-isms for method/class annotations
- Miscellaneous tech debt clean-up
- Miscellaneous tech debt clean-up
- Changed return type of exception logic in Assets service to string
- Changed logging to Craft::warn() for stdout
2 changes: 1 addition & 1 deletion src/DamPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DamPlugin extends Plugin
public static Plugin $plugin;

public bool $hasCpSettings = true;
public string $schemaVersion = "5.0.0";
public string $schemaVersion = "2.0.0";

/**
* @param $id
Expand Down
19 changes: 13 additions & 6 deletions src/migrations/m230412_233209_namespace_change_migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class m230412_233209_namespace_change_migration extends Migration
public function safeUp(): bool
{
echo "m230412_233209_namespace_change_migration executing...\n";
Craft::info("Inside of safeUp!!!!", "shavvy!");

$this->update('{{%fields}}', [
"type" => 'lsst\dam\fields\DAMAsset',
],[
"type" => 'lsst\dam\fields\DAMAsset'
],[
"type" => 'rosas\dam\fields\DAMAsset'
]);
]
);

return true;
}
Expand All @@ -32,7 +32,14 @@ public function safeUp(): bool
*/
public function safeDown(): bool
{
echo "m230412_233209_namespace_change_migration cannot be reverted.\n";
return false;
echo "m230412_233209_namespace_change_migration is be reverted.\n";

$this->update('{{%fields}}', [
"type" => 'rosas\dam\fields\DAMAsset'
],[
"type" => 'lsst\dam\fields\DAMAsset'
]
);
return true;
}
}
14 changes: 4 additions & 10 deletions src/services/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,12 @@ public function getAuthToken($validateOnly = false) : string {

return $authToken;
} else {
Craft::info("An exception occurred in getAuthToken()", "UDAMI");
return [
"status" => "error",
'errorMessage' => 'An error occurred fetching auth token!'
];
Craft::warn("An exception occurred in getAuthToken()", "UDAMI");
return 'An error occurred fetching auth token!';
}
} else {
Craft::info("An exception occurred in getAuthToken()", "UDAMI");
return [
"status" => "error",
'errorMessage' => 'DamPlugin is not configured to authenticate!'
];
Craft::warn("An exception occurred in getAuthToken()", "UDAMI");
return 'DamPlugin is not configured to authenticate!';
}

}
Expand Down

0 comments on commit 43cb1e1

Please sign in to comment.