Closed (won't fix)
Project:
Nodeblock
Version:
7.x-1.7
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2015 at 02:09 UTC
Updated:
25 Dec 2016 at 12:22 UTC
Jump to comment: Most recent
After upgrading to 7.x-1.7, I got the error Parse error: syntax error, unexpected ':' in /users/challengefc/public_html/challengefc.org/sites/all/modules/nodeblock/nodeblock.module on line 499
The offending code was
$block_title = $values ?: ($node->nid ? '' : _nodeblock_node_title($node, $langcode));
Making the following change fixed the problem.
$block_title = $values ? NULL : ($node->nid ? '' : _nodeblock_node_title($node, $langcode));
I'm running PHP 5.3.29-pl0-gentoo
Thanks!
Dan
Comments
Comment #2
Johnny vd Laar commentedPhp 5.3 isnt supported anymore by the php team. I'm not supporting it either. You should update your webserver.
Comment #3
tille commentedAfter updating to nodeblock 7.x-1.7 I had the same error message which basically broke my site. The code change Dan described above will fix the issue. I'm running on PHP 5.6.17.
Thank you!
Comment #4
scb commentedSorry to re-open this, but I have the same problem in some of my sites, and I'm not able to upgrade the server's PHP at the moment.
According to https://www.drupal.org/docs/7/system-requirements/php, Drupal 7 core and modules support php 5.3. Also, it seems this single line of code is the only thing that makes it non working in php 5.3, so could you please consider applying the fix?
Thanks!
Comment #5
Johnny vd Laar commentedNo PHP 5.3 is not a supported PHP version anymore: http://php.net/supported-versions.php
It's already EOL for 2 years. If we keep maintaining old versions of software then we repeat the whole IE 6/7/8 situation which nobody should ever want.
Comment #6
gjhinc commentedSame problem with PHP 5.6. Same fix by adding NULL to line 499.