Closed michaelhue closed 11 months ago
I'm also getting this error using graphql.
Running into this again. Looks like it happens when the field is left empty and fallback adaptor isn't initializing width and height.
Inside src/adapters/FallbackAdapter.php
set
$this->height = null;
$this->width = null;
inside init()
Seems to do the trick.
Here's the full edited file. Let me know if a PR is helpful.
<?php
/**
* oEmbed plugin for Craft CMS 3.x
*
* A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.
*
* @link https://github.com/wrav
* @copyright Copyright (c) 2017 reganlawton
*/
namespace wrav\oembed\adapters;
use Embed\Adapters\Adapter;
use Embed\Utils;
class FallbackAdapter extends Adapter
{
protected function init()
{
$this->providers = [];
$this->height = null;
$this->width = null;
}
public function getCode()
{
if (!$this->url) {
return Utils::iframe($this->url);
}
return null;
}
}
Is there any way this fix can be added to the project? It's a bummer that graphql completely errors out if content editors did not enter an embed.
Finding my way back here after adding this plugin to another project. Any possibility of a fix here?
@sgtpenguin Is this still an issue? I believe this was resolved in v2.3.1 PR.
I'll close the issue unless there is an issue
Since upgrading to the latest 1.3.11 version my client sometimes gets this error:
The twig code:
The full stack trace: