Allow values with leading zeros in number field

Created on 21 June 2019, almost 6 years ago
Updated 26 April 2023, almost 2 years ago

Having this field:

langcode: cs
status: true
dependencies:
  config:
    - commerce_order.commerce_order_type.default
    - field.storage.commerce_order.field_testfield
id: commerce_order.default.field_testfield
field_name: field_testfield
entity_type: commerce_order
bundle: default
label: testfield
description: ''
required: false
translatable: false
default_value: {  }
default_value_callback: ''
settings:
  min: null
  max: null
  prefix: ''
  suffix: ''
field_type: integer
langcode: cs
status: true
dependencies:
  module:
    - commerce_order
id: commerce_order.field_testfield
field_name: field_testfield
entity_type: commerce_order
type: integer
settings:
  unsigned: false
  size: normal
module: core
locked: false
cardinality: 1
translatable: true
indexes: {  }
persist_with_no_fields: false
custom_storage: false

When filled by "1" it will accept value. When filled by "01" it will fire "This value should be of the correct primitive type."

I would expect it will accept values leading with 0 because it is correct number.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
Field  →

Last updated 3 days ago

Created by

🇨🇿Czech Republic Honza Pobořil

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024