-
Notifications
You must be signed in to change notification settings - Fork 37
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
Division by zero error in both backend and frontend #134
Comments
I have the same error (Craft v. 4.4.5 and latest OEmbed 2.3.0) running on PHP 8.2. @arentsen - please backup before trying this, but I think if you change the URL of the problematic field to For me, I found found this was the problematic one: Ideally this would fail more gracefully! I also found that Turning the cache off allows you in to edit and mend, but turning it back on breaks the page again. It's not viable for me to leave the cache on. I removed the troublesome embed. |
Good that you were able to remove it. I wasn't able to do it. For me it helped to change a few checkboxes in the plugin's settings (don't remember which ones) and I have kept those settings since. |
This is This will be a major release v3.0.0 but for anyone you should be able to just |
Reopen if need |
After updating to Craft 4 and also the latest version of Oembed, I have an issue with a oembed video field. The front end as well as the backend (!) give the same error, so it is not possible to see in the backend what could be wrong with the video URL. The error message is:
Division by zero
558559560561562563564565566567568569570571572573574575576 * (useful to make it responsive).
*
*/
public function getAspectRatio()
{
if ($this->width !== null
&& (strpos($this->width, '%') === false)
&& $this->height !== null && (strpos($this->height, '%') === false)) {
return round(($this->height / $this->width) * 100, 3);
}
return null;
}
The line that causes this error in the CMS is:
{{ block.getFieldLayout().createForm(block, static).render()|raw }}
On the front end it is the following line that causes the error:
{% if mediaEmbed.valid %}
I can only access the entry that has the video field when I disable the plugin, but it does not give me any more information. It just says that the field belongs to a disabled plugin. I cannot even remove the video link that caused the problem.
Of course, it should not throw off the backend and frontend, just because some content editor saves a wrong video url. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: