Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

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

Solved by Joel Moser View solution

Started by Joel Moser 2 years ago · 2 replies · 343 views
2 years ago

Hi,

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?

2 years ago

@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
2 years ago Solution

@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

Suggested topics

Topic Participants Replies Views Activity
Support · by Anna, 23 hours ago
2 70 2 hours ago
Support · by gtx, 1 week ago
4 233 2 days ago
Support · by Paul Hodges, 2 weeks ago
13 283 5 days ago
Support · by Anna, 3 weeks ago
9 340 1 week ago
Support · by TomW, 2 weeks ago
4 192 2 weeks ago