Usage of trailing comma causing syntax error on PHP 7.4

Created on 20 September 2023, 9 months ago
Updated 21 September 2023, 9 months ago

Problem/Motivation

In the commit f3cebd3c which fixed issue [ 🐛 Add inline SVG support for stage_file_proxy Fixed ] this module requires PHP ^8.0 because of the trailing comma in the method parameters declaration, however this is not declared in the module info.yml nor in the composer.json, which causes auto-updates to apply even when the module is not compatible.

Steps to reproduce

1. Run Drupal 9 on php7.4
2. Update to 2.2.1
3. ParseError: syntax error, unexpected ')', expecting variable (T_VARIABLE) in line 407 of .../svg_image_field/src/Plugin/Field/FieldFormatter/SvgImageFieldFormatter.php.

Proposed resolution

Step 0: Release a new version ASAP with a fix (just removing the comma should be enough).

After that there are only two fixes possible:

  • - Maintainers have decided to not pursue this option due to contrib time constraints and cognitive load of committing new features to two branches.
  • Require PHP ^8.0 in composer.json and info.yml and move forward - Maintainers agree to follow this approach

Remaining tasks

TBD

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

🇳🇴Norway esolitos Trondheim

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

Comments & Activities

Production build 0.69.0 2024