Hi, On 2 March 2011 08:43, yuppie <y.2011@wcm-solutions.de> wrote:
Hi!
ZPublisher.Publish and zope.publisher.publish process form inputs differently. Zope 2 returns encoded strings unchanged if no converters are specified. zope.publisher converts encoded strings to unicode.
One major reason why zope.formlib and z3c.form can't be used directly in Zope 2 is the fact they expect decoded form values. five.formlib uses special base classes and plone.z3cform monkey patches the base classes in z3c.form.
Proposal:
- Products.Five.browser.decode should be moved to ZPublisher. processInputs and setPageEncoding are publisher related code.
+1
- After traversal and before calling the object ZPublisher.Publish.publish should figure out if the object expects zope.publisher behavior. Either we use a new interface for this or we use zope.publisher.interfaces.browser.IBrowserPage: AFAICS in Zope 2 land only zope.formlib and z3c.form based views implement IBrowserPage.
Isn't this in zope.browserpage now?
- If the object implements that interface, the request is post processed using processInputs and setPageEncoding.
+1
- plone.z3cform uses a modified version of processInputs and doesn't use setPageEncoding. Can anybody explain why? I guess that are no z3c.form specific reasons. Maybe the changes can be merged back to Zope?
processInputs() in Five was very buggy. I thought I'd merged those changes into Zope 2? I don't know what setPageEncoding() does, though. Martin