Undefined array key warning with Tablefield 2.4

Created on 4 September 2023, about 1 year ago
Updated 17 April 2024, 7 months ago

Problem/Motivation

The Tablefield module has introduced a new weight value in the table data in the latest version 2.4 (ref. #3040358: Drag table rows ? ). This is causing undefined array key warnings.

Note that there is currently an open issue to revert this change, but there has not been a response from the maintainer. If this is included in a future release of Tablefield then this fix is not needed any more. Ref 🐛 Drag & drop addition adds meaningless numbers to table data, could break integrating code RTBC

Steps to reproduce

  1. Update Tablefield to 2.4.
  2. Edit an entity that includes a field using Charts Field Formatter, and resave it.
  3. View the entity

Result:

Warning: Undefined array key 2 in Drupal\charts_field_formatter\Plugin\Field\FieldFormatter\ChartsFieldFormatter->viewElements() (line 123 of modules/contrib/charts_field_formatter/src/Plugin/Field/FieldFormatter/ChartsFieldFormatter.php).

Proposed resolution

Unset the weight value before processing the table data.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇧🇬Bulgaria pfrenssen Sofia

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

Comments & Activities

Production build 0.71.5 2024