Skip to content

Commit

Permalink
Merge branch 'release/4.0.2' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed May 10, 2022
2 parents 9daee51 + acc9175 commit 067f05a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Recipe Changelog

## 4.0.2 - 2022.05.10
### Fixed
* Fix array access on new type Int ([#59](https://github.com/nystudio107/craft-recipe/pull/59))

## 4.0.1 - 2022.05.09
### Fixed
* Fixed an issue where model properties were not converted from an array to an `int` before saving ((#57)[https://github.com/nystudio107/craft-recipe/issues/57])
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-recipe",
"description": "A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support",
"type": "craft-plugin",
"version": "4.0.1",
"version": "4.0.2",
"keywords": [
"craft",
"cms",
Expand Down
6 changes: 3 additions & 3 deletions src/models/Recipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public function getImageUrl($transform = null): ?string
{
$result = '';
if ($this->imageId) {
$image = Craft::$app->getAssets()->getAssetById($this->imageId[0]);
$image = Craft::$app->getAssets()->getAssetById($this->imageId);
if ($image) {
$result = $image->getUrl($transform);
}
Expand All @@ -473,7 +473,7 @@ public function getVideoUrl(): ?string
{
$result = '';
if ($this->videoId) {
$video = Craft::$app->getAssets()->getAssetById($this->videoId[0]);
$video = Craft::$app->getAssets()->getAssetById($this->videoId);
if ($video) {
$result = $video->getUrl();
}
Expand All @@ -489,7 +489,7 @@ public function getVideoUploadedDate(): ?string
{
$result = '';
if ($this->videoId) {
$video = Craft::$app->getAssets()->getAssetById($this->videoId[0]);
$video = Craft::$app->getAssets()->getAssetById($this->videoId);
if ($video) {
$result = $video->dateCreated->format('c');
}
Expand Down

0 comments on commit 067f05a

Please sign in to comment.