Created on 10 May 2023, about 1 year ago
Updated 23 July 2023, 11 months ago

Hi! I run drush tome:static --uri=http://my.site and get error on PHP 7.4

ParseError: syntax error, unexpected '|', expecting ';' or '{' Π² Composer\Autoload\includeFile() (line 37 /var/www/web/modules/contrib/tome/modules/tome_sync/src/Normalizer/EntityReferenceRevisionItemNormalizer.php)

On PHP 8.1 error is gone. Is still PHP 7.4 support in tome?

πŸ› Bug report
Status

Active

Version

1.11

Component

Code

Created by

ivnish Poland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ivnish
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    8.0 is the minimum recommended for Drupal 9.5.9

    try downgrading to an older version of tome

    composer require drupal/tome:1.10

    If 1.10 doesn't work, downgrade to 1.9

    composer require drupal/tome:1.9

    If 1.9 doesn't work, downgrade to 1.8

    composer require drupal/tome:1.8

    If all else fails, upgrade PHP to 8.1

  • ivnish Poland

    Hi joseph!

    Thanks, but I know how to downgrade modules or change PHP versions.

    My question was about the minimal supporting PHP version for tome module. If PHP 7.4 doesn't support then we need to add special parameter to tome.info.yml to say what is minimal version PHP is required to enable this module

    For example: php: 8.0

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Hi ivnish, I'm not a maintainer on this project, just responding to your comments, I agree, yes "ideally" there would have been a release of "tome" tagged of tome that has php >= 7.4 <= 8.0 but it appears there was not.

    This allows composer to figure things out for everyone.

    Symfony based Drupal is more aligned with zend support which is only a few recent versions of PHP at a time (zend dropped PHP 7.4 support recently) , older versions are supported by third party vendors like IBM/Red Hat and Canonical or Oracle for instance but not zend.

    With that said, composer won't let anyone upgrade to Drupal 10 unless you're running PHP >= 8.1. This is because the version of symfony included in Drupal 10 supports these versions only.

    on the latest Drupal 9.5.9 you should be able to use PHP 8.0 or 8.1 and possibly as low as 7.4 but to use PHP 8.2 you'll need to upgrade to Drupal 10.0.x which I've been testing out lately and with the help of the upgrade_status module and the provided status page in the reports section and also thanks to a drush command to analyze my custom code it's been fairly quick/easy to get upgraded.

    If you want support for all versions of PHP, Drupal 7 supports all versions from 5.3 through 8.2 and most of the popular D7 contrib modules will support between 5.3 or 5.4 and php 8.2. One of my Drupal 7 sites is using PHP 8.2 (very fast/high performance with this version of PHP).

  • πŸ‡¬πŸ‡§United Kingdom alexmoreno

    This is actually an issue in the docs. You will hit this problem as well doing for example a drush uli in php 7.4:

    ddev drush uli
     [error]  ParseError: syntax error, unexpected '|', expecting ';' or '{' in Composer\Autoload\{closure}() (line 37 of /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Normalizer/EntityReferenceRevisionItemNormalizer.php) #0 /var/www/html/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/var/www/html/w...')
Production build 0.69.0 2024