Ticket #9865 (closed Bug: fixed)
Acquisition in IAdding + object fails
|Reported by:||do3cc||Owned by:||hannosch|
Acquisition is no longer working on the + object in Plone 4. I modified an existing project to work with Plone 4, one of the actions I needed to do, was adding the new add_view_expr that should point to the right url. That works, so this is not the issue. But upon accessing that url, I get an AttributeError for the attribute main_template.
Further, the code in question that tries to call the main_template is not in my project, but the form plone/app/form/addingpageform.pt
I have created a minimal test case, that tries to get the maintemplate via unrestrictedTraverse. The test passes in Plone 3.3 and fails in Plone 4.
Some information that might be interesting. The code:
adding = self.portal.unrestrictedTraverse('+') print 'adding', adding print 'bases', adding.class.bases print 'is implicit:', isinstance(adding, Implicit)
The output in Plone 3.3: adding <+ at +> bases (<class 'plone.app.content.browser.adding.CMFAdding'>, <class 'Products.Five.browser.metaconfigure.ViewMixinForTemplates'>) is implicit: True
The output in Plone 4: adding <+ at /plone/+> bases (<class 'plone.app.content.browser.adding.CMFAdding'>, <class 'Products.Five.browser.metaconfigure.ViewMixinForTemplates'>) is implicit: True
Maybe this is relevant for the issue, I am not sure: http://zope3.pov.lt/trac/changeset/78447/
- Status changed from assigned to closed
- Resolution set to fixed