Rendering a form fails with "AttributeError: 'str' object has no attribute 'other'"
Zope 2 and Zope 3 each provide their own version of the ViewPageTemplateFile class.
- Zope 2 view template
- from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
- Zope 3 view template
- from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
When using z3c.form in Plone, the Zope 2 class must be used when overriding the template of a form wrapper, but the Zope 3 class must be used when overriding the template of an actual form.
Otherwise, you'll see a traceback ending something like this:
Module z3c.form.form, line 156, in render Module Shared.DC.Scripts.Bindings, line 313, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Shared.DC.Scripts.Bindings, line 1, in ? Module Shared.DC.Scripts.Bindings, line 293, in _getTraverseSubpath AttributeError: 'str' object has no attribute 'other'
