[Seaside] Nested form tags
Michel Bany
m.bany at wanadoo.fr
Fri Nov 4 07:26:42 CET 2005
Ramon Leon a écrit :
>>I believe I found the bug that causes the weird effects that
>>have been observed when nesting forms.
>>
>>
>>
>
>I would think the bug would be nesting forms in the first place, I
>believe that's invalid html, form tags should not be nested.
>
>
>
Yes, but if you happen to accidentally nest forms, the current result is
an expired session.
This does not help much in identifying that forms were nested. On the
other hand, the fact
that Seaside expires sessions when the http request contains multiple
values for the same
form field name, is a real bug.
My opinion is that the bug is in Comanche where method
#decodeUrlEncodedForm:multipleValues:
answers sometimes an ordinary Dictionary and sometimes an
HttpFormDictionary object. These
two objects do not have the exact same behavior (at least as far as
Seaside is concerned),
the former has String values, the later has Collection values. The fix I
am suggesting eliminates
the effect of the Comanche bug and changes Seaside so that it copes with
this difference in behavior,
substituting Collection values with the first String of the collection :
fields := aKomRequest method = 'POST'
ifTrue: [aKomRequest postFields]
ifFalse: [aKomRequest getFields].
waFields := Dictionary new.
fields keysAndValuesDo: [:k :v | v isString
ifFalse: [waFields at: k put: v first]
ifTrue: [waFields at: k put: v]].
VisualWorks does not have this bug. The http form fields are
consistently made of Collection
objects.
More information about the Seaside
mailing list