Uncaught DivisionByZeroError in Environment.php #603
-
|
Hi, The error occurs when all ACF fields are not filled out for a Component in the post editor and the draft is saved; these ACF fields are marked required in the post editor, but I can't find in ACF Field Groups or in the Component templates where they are set to be required. Can someone offer help on where I should be looking or what I should be doing? I'm using Local localwp.com and PHP 8.2.27 Fatal error: Uncaught DivisionByZeroError: Division by zero in /Users/macuser/Local Sites/mtlocal/app/public/wp-content/themes/flynt-theme/vendor/twig/twig/src/Environment.php(418) : eval()'d code:86 Flynt/Components/BlockImageText/functions.php: Flynt/Components/BlockImageText/index.twig: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
@mtbluedog It sounds like there’s a division by zero happening in one of the A quick fix would be to add an if condition to prevent the calculation when the denominator is zero. However, without seeing the exact |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the extensive answer! I inherited this site, and I think it was built about 5 years ago, so that's why the Flynt version is old, I think. I'm still learning Twig and PHP. The issue did turn out to be Thanks much. I'm sure I will have other questions in the future. |
Beta Was this translation helpful? Give feedback.
@mtbluedog it think
500 / image.aspectis the problem. May checking if the image exists help in your case:flynt/Components/BlockImageText/index.twig
Line 3 in a934c44