Problem/Motivation

Admin users are unable to log in, and this shows up in the error logs:

PHP Parse error:  syntax error, unexpected '.', expecting ',' or ';' in /var/www/drupal/ssu-7.73-20201112/sites/all/modules/contrib/siteimprove/includes/SiteimproveUtils.php on line 13

Steps to reproduce

Install and enable siteimprove, and log in as a user with admin access.

CommentFileSizeAuthor
#4 3183031_php54_parse_error.diff1.21 KBbeltofte

Comments

freiheit created an issue. See original summary.

beltofte’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Hi Eric,

I have tried to reproduce the issue in a local Docker environment with latest version of Drupal 7 and on both PHP 7.2, 7.3 and 7.4 and can't reproduce the error. There are no syntax errors in SiteimproveUtils.php when looking in code stored in Drupal.org git. See https://git.drupalcode.org/project/siteimprove/-/blob/7.x-1.2/includes/SiteimproveUtils.php#L13

Please share some more details about your environment? Which PHP version are you using?

Please, also check that you are on version 7.x-1.2 of Siteimprove module and if not then please upgrade to the latest version.

Best regards,
jens

freiheit’s picture

This is Drupal 7.74 and PHP 5.4.16 on CentOS 7.9. Siteimprove version is 7.x-1.2.

(we've since updated drupal to 7.75, but rest is the same versions)

beltofte’s picture

StatusFileSize
new1.21 KB

Thanks @freiheit. Looks like the issue is related to constant expression not supported by PHP before version 5.6 if I'm not wrong.

Is it possible that you can test the attached patch on PHP 5.4?

craigra’s picture

I had the same syntax error on PHP 5.4.40. The patch in #4 fixed the error for me.

  • bartvig committed 5a29f93 on 8.x-1.x
    Issue #3183031 by beltofte, freiheit, craigra: Admin users unable to...
bartvig’s picture

Status: Postponed (maintainer needs more info) » Fixed

Fixed in latest dev version.

bartvig’s picture

Status: Fixed » Needs work

Forget my previous comment, that was for Drupal 8.

  • bartvig committed 7417dcd on 7.x-1.x authored by beltofte
    Issue #3183031 by beltofte, freiheit: Admin users unable to login;...
bartvig’s picture

Status: Needs work » Fixed

And now fixed for version 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.