Hi Christian!

Christian Heimes wrote:
While I was working on the CMF 1.5 integration into AT and ATContentTypes for Plone 2.1 I had some issues with the view on folders. After some digging I found these interesting results:

CMFCore.PortalObject defines __call__ to use method aliases and _getViewFor() as fallback, view = __call__ and index_html = None.

CMFDefault.SkinnedFolder defines __call__ to use _getViewFor(), view = __call__ and index_html = None

CMFCore.PortalFolder doesn't hook into index_html/__call__ publishing at all.

What's the reason PortalFolder doesn't define __call__ at all? Shouldn't it use __call__ to get the view from method aliases or _getViewFor() as fallback?

1.) PortalFolder did never have a __call__ method and apparently nobody missed it so far.

2.) I know only one situation where we need to call an object directly: If a content object is used as a view method. That is e.g. the case for 'index_html' documents, but doesn't make much sense with folders.

Why does SkinnedFolder still uses the old and deprecated way as default way to get the view and why does it ignore method aliases completly? IMO SkinnedFolder.__call__ is buggy and wasn't fixed when method aliases were introduced.

Like other folders a skinned folder should never be used as method, so __call__ should never be invoked. That code exists just for backwards compatibility and is completely removed on HEAD.



Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to