Undefined array key warning with Tablefield 2.4

Created on 4 September 2023, 9 months ago
Updated 17 April 2024, about 2 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.69.0 2024