Bug #26552
Can't store addresses when using select field with value list
| Status: | Resolved | Start date: | 2011-05-02 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 100% |
|
| Category: | Bug | Spent time: | - | |
| Target version: | - | |||
| Votes: | 0 |
Description
While trying to add the gender field from tt_address to the forms in pi4 I stumbled over the following error:
Problem:
You can define a select box with a value list, which is working fine in the edit/create-form:
tx_commerce_pi4.formFields.gender {
type = select
values {
m = Herr
f = Frau
}
}
However, when you store the address, pi4 tries to fetch the label for the selected value from the database, which fails as no table is defined here intentionally.
Steps to reproduce:
To reproduce this, add the following config to your TS, add the marker ###FIELD_GENDER### to the pi4-template, log in, and try to create a new address in checkout process.
Solution:
One solution I saw on some systems is, to create a static table that contains nothing but the value/label-list. A cleaner solution is done in the attached patch: If the select-field has no table defined, but a value list, use the value list from TS-configuration to get the label. It also throws a more descriptive exception than TYPO3 does, if no values are configured at all.
Related issues
| duplicated by commerce - Bug #8112: 'NO entry in the $TCA-array' if using an additonal <selec... | Closed | 2010-06-09 |
Associated revisions
Fixed #26552: Can not store addresses when using select field with value list (Thanks to Michael Knabe)
Fixed #26552: Can not store addresses when using select field with value list (Thanks to Michael Knabe)
History
Updated by Michael Knabe about 2 years ago
- File commerce_26552.diff added
Updated by Michael Knabe about 2 years ago
- File commerce_26552_v2.diff added
Updated by Christian Kuhn about 2 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset r47748.