Problem/Motivation

Having numeric column names leads to the following fatal error:

TypeError: Drupal\custom_field\Plugin\Field\FieldFormatter\BaseFormatter::prepareFormattedSubfieldValue(): Argument #3 ($name) must be of type string, int given, called in /var/www/html/web/modules/contrib/custom_field/src/Plugin/Field/FieldFormatter/BaseFormatter.php on line 557 in Drupal\custom_field\Plugin\Field\FieldFormatter\BaseFormatter::prepareFormattedSubfieldValue()

Steps to reproduce

Create a custom field with numeric column names

Proposed resolution

Handle this case better

Remaining tasks

Write fix
Write test
Review

User interface changes

None

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lendude created an issue. See original summary.

lendude’s picture

Status: Active » Needs review

Pushed a fix and test for this.

Cursor was used to help create the fix and test.

apmsooner made their first commit to this issue’s fork.

apmsooner’s picture

Status: Needs review » Fixed

Thank you for the patch!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.