Repository navigation
[6.x] Show select option labels for numeric keys in form submissions - #15744
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Front-end form submissions store select values as strings, so a field with numeric option keys (e.g.
key: 926450000) is saved as'926450000'. The CP then compares that against the integer key, finds no option, and shows the raw key instead of the label, both in the submissions list and on the submission itself. String keys aren't affected.Entries don't hit this because the CP saves the integer, which is probably why #12840 couldn't reproduce it. To reproduce: give a form a select with numeric keys, submit it from the front end, and open its submissions.
This maps the string back to the matching integer key in
preProcess(), which covers both views. An exact key match still wins, and it only matches the exact string, so'01'doesn't match key1.Fixes #12667
🤖 Generated with Claude Code