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
Issue fork custom_field-3593642
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
Comment #2
lendudePushed a fix and test for this.
Cursor was used to help create the fix and test.
Comment #5
apmsooner commentedThank you for the patch!