[TYPO3-core] RFC: #10442: Select doesn't allow comma in value

Steffen Kamper info at sk-typo3.de
Mon Feb 16 18:22:54 CET 2009


Hi olly,

Oliver Hader schrieb:
> Hi Steffen,
> 
> Steffen Kamper schrieb:
>> Hi,
>>
>> This is SVN patch request.
>>
>> Type: Bugfix
>>
>> Branches: trunk
>>
>> BT reference: http://bugs.typo3.org/view.php?id=10442
>>
>> Problem:
>> Select doesn't allow comma in value. This has a reason: multiselects
>> (select with maxitems>1) are saved as comma-seperated list.
>> Proceeding the value while save and read use an explode on the comma to
>> seperate the values again.
>>
>> This doesn't make sense for single selects. As they could be used also
>> in a FCE, where the value isn't processed in an extension but passed
>> directly to FE, usage of comma in value makes sense.
>>
>> Solution:
>> Attached patch differenciate between single and multiselect and explode
>> the value only for selects having maxitems>1
>>
>> Additional Information:
>> I placed a test extension in BT. Install and create a test record
>> ("fields") in a sysfolder.
> 
> The method
> t3lib_TCEmain::checkValue_group_select_explodeSelectGroupValue() does
> some more stuff like extracting the id from input values like
> "123|The%20record%20title", where "123" is the information to be extracted.
> This could occur on groub/db fields that allow only one relation
> (maxitems=1) but different tables to be related.
> 
> Another problem I see is in updated extensions. Imagine a field once was
> defined to accept more than one relation (maxitems>1), data was stored
> in the database like "11,12,13" and then the field was changed to only
> accept one relation (maxitems=1).
> Then t3lib_transferData returns a non-valid element with the id
> "11,12,13"...
> 
> Could you please point out, how the comma is used in FCEs for a single
> element? Thanks in advance!
> 
> olly

here is an example of usage of a select in FCE, having maxitems=1 and 
using a comma in value:
<TCEforms type="array">
     <config type="array">
      <type>select</type>
      <items type="array">
       <numIndex index="0" type="array">
        <numIndex index="0">Angabe in Textfeld / input in 
textfield</numIndex>
        <numIndex index="1"></numIndex>
       </numIndex>
       <numIndex index="1" type="array">
        <numIndex index="0"><![CDATA[Gebundenes Buch, 192 Seiten, 12,2 x 
18,8 cm]]></numIndex>
        <numIndex index="1"><![CDATA[Gebundenes Buch, 192 Seiten, 12,2 x 
18,8 cm]]></numIndex>
       </numIndex>
       <numIndex index="2" type="array">
        <numIndex index="0"><![CDATA[Hardcover, 192 pages, 12,2 x 18,8 
cm]]></numIndex>
        <numIndex index="1"><![CDATA[Hardcover, 192 pages, 12,2 x 18,8 
cm]]></numIndex>
       </numIndex>
      </items>
      <default>0</default>
     </config>
     <label>Format Dropdown</label>
    </TCEforms>

it's exact the example i used in the testextionsion for the record. FE 
render passes the value of select, which will be the rendered text here.

I see the problem mentioned with group-data, which could be used to 
differntiate also beside maxitems. I don't see the problem for a filed 
being manipulated after data filling as i don't see this as a usual case.

vg Steffen


More information about the TYPO3-team-core mailing list