Release 8.1 breaks with PHP 7.4

Created on 11 February 2025, 2 months ago

Problem/Motivation

When updating my drupal 9.5 project, drupal/rabbit_hole got updated from 1.0.0-beta10 to 1.0.0.
Now I get a PHP error:

ParseError: syntax error, unexpected ')', expecting variable (T_VARIABLE)
in Composer\Autoload\{closure}()
(line 91 of modules/contrib/rabbit_hole/src/BehaviorSettingsManager.php).

My system uses PHP 7.4 (which is still supported by Drupal 9), but commit 82440376339ca292d9fbde82328220ae65ac1616 added a trailing comma to method signature:

private function generateBehaviorSettingsFullId(
    $entity_type_id,
    $entity_id = '',
  ) {

which is not supported on PHP 7.4

Unfortunately, composer.json does not specify a supported PHP version range, so the upgrade breaks here.

Proposed resolution

Either make the 1.x code compatible with PHP 7.4, or define a PHP version constraint in composer.json and re-release 1.0.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany cweiske

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024