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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

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 · 264 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 Thomas, 1 week ago
2 57 15 hours ago
Support · by Anna, 3 days ago
2 65 18 hours ago
Support · by Justin Young, 19 hours ago
1 33 18 hours ago
Support · by Duc , 1 week ago
2 68 5 days ago
Support · by Colin Hume, 1 week ago
2 60 6 days ago