Undefined property: DiffFormatter::$line_stats DiffEngine.php:861 with PHP 8

Created on 27 April 2023, about 1 year ago
Updated 5 May 2023, about 1 year ago

Problem/Motivation

Error when running drush fda with PHP 8:

Undefined property: DiffFormatter::$line_stats DiffEngine.php:861 [warning]
Undefined array key "counter" DiffEngine.php:861 [warning]
Undefined array key "x" DiffEngine.php:861 [warning]
Undefined array key "y" DiffEngine.php:864

Steps to reproduce

Install features and diff, create a feature with a diff, run drush fda.

Proposed resolution

Define $line_stat property in DiffFormatter class, as it is defined in DrupalDiffFormatter class. Features uses the DiffFormatter class directly.

πŸ› Bug report
Status

RTBC

Version

3.4

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States lwalley

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

Comments & Activities

  • Issue created by @lwalley
  • Open on Drupal.org β†’
    Core: 7.x + Environment: PHP 5.3 & MySQL 5.5
    last update about 1 year ago
    Waiting for branch to pass
  • @lwalley opened merge request.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States lwalley
  • Status changed to RTBC about 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom oldspot

    After upgrading to PHP 8.1 and latest diff module version I got the exact same warnings.
    Can confirm this patch fixes them and can no longer see them.
    Thanks

Production build 0.69.0 2024