CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #26552

Can't store addresses when using select field with value list

Added by Michael Knabe about 2 years ago. Updated about 2 years ago.

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.

commerce_26552.diff (1.6 kB) Michael Knabe, 2011-05-02 14:28

commerce_26552_v2.diff - Also patches the same piece of code in pi3 (2.9 kB) Michael Knabe, 2011-05-02 18:52


Related issues

duplicated by commerce - Bug #8112: 'NO entry in the $TCA-array' if using an additonal <selec... Closed 2010-06-09

Associated revisions

Revision 47748
Added by Christian Kuhn about 2 years ago

Fixed #26552: Can not store addresses when using select field with value list (Thanks to Michael Knabe)

Revision 47748
Added by Christian Kuhn about 2 years ago

Fixed #26552: Can not store addresses when using select field with value list (Thanks to Michael Knabe)

History

Updated by Christian Kuhn about 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r47748.

Also available in: Atom PDF