diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f1a8b..bdf8289 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # oEmbed Changelog +## 1.3.4 - 2020-06-29 + +### Updated +- Fix to normalizeValue function on GraphQL field's `__get()` magic method. Thanks @joshuabaker + ## 1.3.3 - 2020-06-29 ### Updated diff --git a/README.md b/README.md index 12cff14..a2363f5 100755 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ You can access additional media details using the examples below. Additional Embed information can be found [here](https://github.com/oscarotero/Embed) -## GraphQl +## GraphQL I recommend enabling caching in the plugin settings menu to speed up the API resolve timing. @@ -123,4 +123,4 @@ Changes can be viewed [here](https://github.com/wrav/oembed/blob/master/CHANGELO ## Support -Get in touch via email or by [creating a Github issue](/wrav/oembed/issues) +Get in touch via email, Discord, or by [creating a Github issue](/wrav/oembed/issues) diff --git a/composer.json b/composer.json index 816addc..722be57 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "wrav/oembed", "description": "A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.", "type": "craft-plugin", - "version": "1.3.3", + "version": "1.3.4", "keywords": [ "craft", "cms", diff --git a/src/fields/OembedField.php b/src/fields/OembedField.php index 02ead7e..5fc468f 100755 --- a/src/fields/OembedField.php +++ b/src/fields/OembedField.php @@ -105,7 +105,13 @@ public function getContentGqlType() */ public function normalizeValue($value, ElementInterface $element = null) { - if (is_string($value) && $decValue = json_decode($value, true)) { + if (is_array($value)) { + if (isset($value['url'])) { + return new OembedModel($value['url']); + } + } + + if (is_string($value) && $decValue = json_decode($value, true)) { if (isset($decValue['url'])) { return new OembedModel($decValue['url']); } diff --git a/src/gql/OembedFieldResolver.php b/src/gql/OembedFieldResolver.php index 7089138..88bc8b8 100644 --- a/src/gql/OembedFieldResolver.php +++ b/src/gql/OembedFieldResolver.php @@ -15,7 +15,6 @@ class OembedFieldResolver extends ObjectType { - /** * @inheritdoc */