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

dmeigs created an issue. See original summary.

Johnny vd Laar’s picture

Status: Active » Closed (won't fix)

Php 5.3 isnt supported anymore by the php team. I'm not supporting it either. You should update your webserver.

tille’s picture

After 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!

scb’s picture

Status: Closed (won't fix) » Active

Sorry 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!

Johnny vd Laar’s picture

Status: Active » Closed (won't fix)

No 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.

gjhinc’s picture

Same problem with PHP 5.6. Same fix by adding NULL to line 499.