Inconsistent Select fieldtype form submission handling
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #12840 来自 @mmodler —— 已关闭,未合并
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
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
- 主要语言
- PHP
- 星标
- 4.9k
- 派生
- 647
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 100
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
statamic/cms 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
There's a default crop when cropping images可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭assets
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
accessibility
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
antlers
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 84/100
WordPress/hosting-handbook#506 ·
维护者通常 2 天内回复
-
Installing a plugin with composer_packages installs dev dependencies and breaks the autoloader (Error 500)可能已有人在做 @Boy132 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
nginx: static-file locations drop the security headers, and the dotfile deny is matched after them未关闭bug Low Security
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
backdrop-contrib/commerce#60 ·
-
难度 1/5 1 小时以内 新手友好度 76/100