ZTutils marshalling functions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
ZTUtils.
For example, this form:
> <form>
> <input type="text" value="a token field" name="rec2.
> <textarea name="rec2.
> >First line
> Second
> c⒜✔❀ϚτЄRS<
> <input type="text" name="rec2.
> <input type="text" name="rec2.
> <textarea name="a_
> One
> Two
> Three</
> <input name="a_
> </form>
The REQUEST.form variable built by ZPublisher will be like this :
rec2 = [{'a': ['a', 'token', 'field'], 'b': [[u'First line', u'Second', u'c\u249c\
a_list = [['One', 'Two', 'Three'], 0.01]
And, if you want to regenerate the form with the make_hidden_input function, the (wrong) result looks like as follows: nested lists and dictionnaries are rendered as raw strings, so input data types are lost.
> <input type="hidden" name="rec2:list" value="a: ['a', 'token', 'field'], b: [[u'First line', u'Second', u'c\u249c\
> <input type="hidden" name="a_list:list" value="['One', 'Two', 'Three']">
> <input type="hidden" name="a_
If you install the attached hotfix, the result will be :
> <input type="hidden" name="rec2.
> <input type="hidden" name="rec2.
> <input type="hidden" name="rec2.
> <input type="hidden" name="rec2.
> Second
> c⒜✔❀ϚτЄRS">
> <input type="hidden" name="rec2.
> <input type="hidden" name="rec2.
> <input type="hidden" name="a_
> <input type="hidden" name="a_
You can see on this example that marshalling operators on output forms are not necessary identical to the primary forms, but they keep the semantics.
Changed in zope2: | |
importance: | Medium → Wishlist |
Changed in zope2: | |
status: | New → Confirmed |
The zope2 project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope2.