Problem/Motivation

The website encountered an unexpected error. Please try again later.
ParseError: syntax error, unexpected '|', expecting ';' or '{' in Composer\Autoload\includeFile() (line 121 of modules/visitors/src/Service/CounterService.php).

Steps to reproduce

update from
php 7.4.30 Drupal Version
9.5.10

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork visitors-3383142

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hristos created an issue. See original summary.

hristos’s picture

Issue summary: View changes
bluegeek9’s picture

Priority: Critical » Major

Hi hristos,

That you for reporting the bug. This is the line that has the error:

public function fetchView(string $type, int $id): StatisticsViewsResult|false {

The vertical pipe, |, in `StatisticsViewsResult|false` is the cause the error. This syntax is not supported in PHP 7. We will remove the `|false` in 8.x-2.17

Upgrading to PHP 8.1 or higher should also resolve the error.

keshavv’s picture

Status: Active » Needs review
bluegeek9’s picture

Assigned: Unassigned » bluegeek9
Status: Needs review » Active
bluegeek9’s picture

Title: ParseError: syntax error, unexpected '|' » ParseError: syntax error, unexpected

  • bluegeek9 committed 2648ecc2 on 8.x-2.x
    Issue #3383142 by bluegeek9: ParseError: syntax error, unexpected
    
bluegeek9’s picture

Two of the tests are stilling failing under php 7.4 / mysql 5.7
https://www.drupal.org/pift-ci-job/2748210

I added PHP 7.4 testing to reduce the chances of bugs like this happening in the future.

  • bluegeek9 committed 7839ebd1 on 8.x-2.x
    Issue #3383142 by bluegeek9: ParseError: syntax error, unexpected
    

  • bluegeek9 committed 80c2969e on 8.x-2.x
    Issue #3383142 by bluegeek9: ParseError: syntax error, unexpected
    
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

bluegeek9’s picture

This issue was resolved. A new release, 8.x-2.17, will be made soon, May 31st.

This is an excellent opportunity to beta test the dev branch, and report any issues.

Contributors (5)

bluegeek9, roshni27, abhishek_gupta1, sarwan_verma, SandeepSingh199

Changelog

Issues: 32 issues resolved.

Changes since 8.x-2.16:

Bug

Feature

Task