Problem/Motivation
NumberFieldTestCase uses non-existing formatter number_float causing:
exception: [Notice] Line 633 of modules/field/field.crud.inc:
Trying to access array offset on value of type null
168 $this->instance = array(
169 'field_name' => $this->field['field_name'],
170 'entity_type' => 'test_entity',
171 'bundle' => 'test_bundle',
172 'widget' => array(
173 'type' => 'number',
174 ),
175 'display' => array(
176 'default' => array(
177 'type' => 'number_float',
178 ),
179 ),
180 );
Proposed resolution
Use number_decimal instead
Remaining tasks
Patch review
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
See the parent issue
Comments
Comment #2
taran2lComment #3
taran2lComment #4
taran2lConfirmation against the baseline #3081386-70: [META] Fully support PHP 7.4 in Drupal 7:
Comment #5
joseph.olstadGreat work @Taran2L
Comment #6
mcdruid commentedhttps://git.drupalcode.org/project/drupal/-/blob/7.x/modules/field/modul...
The
number_floatfield indeed usesnumber_decimalas itsdefault_formatter.So yup, this LGTM.
Comment #7
fabianx commentedRTBM - thanks all!
Comment #9
mcdruid commentedThanks everyone!