Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GrapQL - Error when querying an entry with a empty oEmbed URL #156

Open
jaapfaes opened this issue Jul 25, 2024 · 0 comments
Open

GrapQL - Error when querying an entry with a empty oEmbed URL #156

jaapfaes opened this issue Jul 25, 2024 · 0 comments

Comments

@jaapfaes
Copy link
Contributor

jaapfaes commented Jul 25, 2024

Issue:
When running a GraphQL query to fetch an entry that includes an oEmbed field, an error occurs if the oEmbed field does not have a URL specified.

Error Message:
Embed\Embed::get(): Argument #1 ($url) must be of type string, null given, called in /var/www/vhosts/aswakeukens.nl/subdomains/cms/vendor/wrav/oembed/src/services/OembedService.php on line 89

Proposed Solution:
I believe this issue can be easily resolved by passing an empty string when the $url value is null. This prevents the error and allows the query to return a valid response.

Pull Request:
I've created a small PR that addresses this issue. You can review it here: #157.

Thank you for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant