Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

Solved by Joel Moser View solution

Started by Joel Moser 3 years ago · 2 replies · 681 views
3 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?

3 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
3 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 TomW, 2 weeks ago
8 228 9 hours ago
Support · by alex, 2 months ago
8 667 24 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 160 3 days ago
Support · by TomW, 6 days ago
2 106 6 days ago