Unparenthesized `a ? b : c ? d : e` is not supported


I just installed Skeleton Clean Blog with admin and it runs fine on my local hosting, Apache with PHP v 8.2.0.

On my remote hosting, NGINX with PHP v 8.3 I get this:

Fatal error : Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /NAS1/vhosts/FI30477/jack-trent.com/public_www/vendor/twig/twig/lib/Twig/Node.php on line 42

How do I fix this?

@Moser, There used to be an issue in Twig with nested ternaries: a ? b : c ? d: e
This issue has been fixed.

However, theme Clean Blog uses nested Elvis expressions: a ?: b ?: c in its templates blog.html.twig and item.html.twig.

Please share the stacktrace of the error so we can see the origin.

Why the error appears only on nginx I don’t know. Maybe nginx is more tight on errors?

NB. The issue on Github shows a workaround. Please test if using parenthesis will work. If so, ask the author of Clean Blog to add parenthesis.

1 Like

@pantbaau Thank you.

I discovered my problem was a bad installation on the remote server. I guess a bad twig binary was being picked up from somewhere else.

1 Like