Errors and not saving all data to fields

Created on 2 June 2024, 23 days ago
Updated 3 June 2024, 22 days ago

Problem/Motivation

Warning: Undefined array key 0 in Drupal\custom_field\Plugin\CustomField\FieldFormatter\NumericFormatterBase->formatValue() (line 97 of modules/contrib/custom_field/src/Plugin/CustomField/FieldFormatter/NumericFormatterBase.php).
Warning: Trying to access array offset on value of type null in Drupal\custom_field\Plugin\CustomField\FieldFormatter\NumericFormatterBase->formatValue() (line 97 of modules/contrib/custom_field/src/Plugin/CustomField/FieldFormatter/NumericFormatterBase.php).

Steps to reproduce

Versión de Drupal
10.2.6

PHP
Versión
8.1.28

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇪🇸Spain ady1503

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

Comments & Activities

  • Issue created by @ady1503
  • 🇮🇳India deepak5423

    @ady1503 Can you please elaborate on the reproducing steps because I cannot?

  • 🇪🇸Spain ady1503

    It is simple.

    Just add a number field and that's it.
    This error appears when saving the new node also when editing.

    And very important:

    That the error is repeated for each field number of the custom_field in the same content type.

    I also saw a strange thing.

    When you create a new content type and save it, the keys appear and not the values. But if you go to Manage Presentation and simply change the presentation to key in any number field and save, all the number fields show the value and the one you changed shows the key, and then you put it back to value, everything is normal. You have to repeat this matter if you have added another number field, so that all the number fields present the values ​​and not the keys.

    These errors appear only the first time when creating a new content type. Then they no longer appear.

    Create a new content type, add a custom_field of number format.

    Create the first one, and you will see the error, edit it and the error appears. But the following new ones created and edited no longer appear.

    Gracias.

Production build 0.69.0 2024