From: Ross P. <svn...@pl...> - 2010-08-09 21:01:10
|
Author: rossp Date: Mon Aug 9 21:01:03 2010 New Revision: 38679 Modified: plone.app.content/trunk/CHANGES.txt plone.app.content/trunk/plone/app/content/browser/folderfactories.py Log: Use the folder as the factory expression context when a front-page is used as the display for the folder. Tests in plone.app.contentmenu. Modified: plone.app.content/trunk/CHANGES.txt ============================================================================== --- plone.app.content/trunk/CHANGES.txt (original) +++ plone.app.content/trunk/CHANGES.txt Mon Aug 9 21:01:03 2010 @@ -4,6 +4,10 @@ 2.0.2 - unreleased ------------------ +- Use the folder as the factory expression context when a front-page + is used as the display for the folder. Tests in + plone.app.contentmenu. + [rossp] 2.0.1 - 2010-07-18 ------------------ Modified: plone.app.content/trunk/plone/app/content/browser/folderfactories.py ============================================================================== --- plone.app.content/trunk/plone/app/content/browser/folderfactories.py (original) +++ plone.app.content/trunk/plone/app/content/browser/folderfactories.py Mon Aug 9 21:01:03 2010 @@ -71,7 +71,7 @@ # slow. We assume the 'allowedTypes' list has already performed the # necessary calculations actions = types_tool.listActionInfos( - object=context, + object=addContext, check_permissions=False, check_condition=False, category='folder/add', @@ -79,7 +79,7 @@ addActionsById = dict([(a['id'], a) for a in actions]) expr_context = createExprContext( - aq_parent(context), portal_state.portal(), context) + aq_parent(addContext), portal_state.portal(), addContext) for t in allowedTypes: typeId = t.getId() if include is None or typeId in include: |