Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

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

Solved by Joel Moser View solution

Started by Joel Moser 2 years ago · 2 replies · 425 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 blu3prince, 4 days ago
1 69 4 hours ago
Support · by complanar, 7 days ago
6 157 2 days ago
Support · by Rick Beebe, 7 days ago
2 116 3 days ago
Support · by alex, 5 days ago
2 101 4 days ago
Support · by Marcel, 2 weeks ago
1 152 5 days ago