Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Inconsistent Select fieldtype form submission handling

Đang mở
#12,667 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #12840 của @mmodler — đã đóng, không merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
laravel, php, yaml
Lĩnh vực
backend

Hướng nghiên cứu

Reproduce this with the provided YAML blueprint: create a form containing select options with numeric keys and string keys, submit it, and inspect the submission. Start by tracing how select field values are displayed when viewing submissions; the payload names no source files or tests. Done means both kinds of keys display the option label consistently, while submissions still retain the values needed by integrations.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

fieldtypes
Bug description

Depending on whether the option keys are strings of characters or numbers, the select fieldtype will show different behaviour when viewing form submissions. If the key is a number, it will show the key. If it is a string of characters, it will show the label.

Image

Is there any way to control which one to display? The number example is taken from a form that is used on one of our sites and is used to post to a CRM - those keys are some of its IDs so we can't actually change these.

How to reproduce

Create a form with the following blueprint:

tabs:
  main:
    display: Main
    sections:
      -
        fields:
          -
            handle: test_number_keys
            field:
              options:
                -
                  key: 926450000
                  value: 'test 1-9'
                -
                  key: 926450001
                  value: 'test 10-49'
                -
                  key: 926450002
                  value: 'test 50-249'
                -
                  key: 926450003
                  value: 'test 250-999'
                -
                  key: 926450004
                  value: 'test 1000-4999'
                -
                  key: 926450005
                  value: 'test 5000+'
              type: select
              display: 'Test number keys'
          -
            handle: test_string_keys
            field:
              options:
                -
                  key: Eggs
                  value: 'Eggs label'
                -
                  key: Beans
                  value: 'Beans label'
                -
                  key: Bacon
                  value: 'Bacon label'
              type: select
              display: 'Test string keys'

Load the form in a page with the form tag, submit it, check the submission.

Logs

Environment
Environment
Application Name: Statamic
Laravel Version: 12.32.5
PHP Version: 8.3.22
Composer Version: 2.8.9
Environment: local-db
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 7
Sites: 1
Stache Watcher: Disabled (auto)
Static Caching: Disabled
Version: 5.65.2 PRO

Statamic Addons
anakadote/statamic-recaptcha: 2.0
eminos/statamic-tabs: 1.2.0
jezzdk/statamic-google-maps: 2.1.0
patrickjunod/image-select: 1.0.0
rias/statamic-redirect: 3.12.0
statamic/eloquent-driver: 4.32.0
withcandour/aardvark-seo: 5.0.5

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Fieldsets: file
Form Submissions: file
Forms: file
Global Sets: file
Global Variables: file
Navigation Trees: file
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: file
Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Ngôn ngữ chính
PHP
Star
4.9k
Fork
647
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
100

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statamic/cms

Tất cả issue của statamic/cms

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.