From: Martin A. <opt...@gm...> - 2007-01-22 11:05:11
|
Jean Jordaan wrote: > Hi all > > The 'view' action in PHCContent is defined like so: > > { > 'id' : 'view', > 'name' : 'View', > 'action' : 'string:${object_url}', > 'permissions' : (CMFCorePermissions.View,) > }, > > I believe this confuses 'getViewTemplateId' in plone.py, causing the > "Add comment" button not to show up for pages. It does show up for > sections, but judging from this trace, I suspect this is by accident: > >> /home/jean/zope/296-instances/bungeni/Products/CMFPlone/browser/plone.py(410)_lookupTypeActionTemplate() > -> try: > (Pdb) fti.getActionInfo('folder/folderlisting')['url'] > 'http://localhost:37090/plone/view' > (Pdb) fti.queryMethodID('view') > 'referencemanualsection_view' > > You see, the object (a HelpCenterReferenceManualSection at > http://localhost:37090/plone/legislation/bill-1 ) > doesn't actually define a 'folderlisting' action, but the mangling that > '_lookupTypeActionTemplate' stumbles across its 'view' action. How so? Really, it should look up the (Default) or view aliases first, afair. > This fixes things: > > $ svn diff > Index: content/PHCContent.py > =================================================================== > --- content/PHCContent.py (revision 36028) > +++ content/PHCContent.py (working copy) > @@ -41,7 +41,7 @@ > actions = ({ > 'id' : 'view', > 'name' : 'View', > - 'action' : 'string:${object_url}', > + 'action' : 'string:${object_url}/view', > 'permissions' : (CMFCorePermissions.View,) > }, > { > @@ -161,4 +161,4 @@ > objs = [o for o in self.getField('relatedItems').get(self) > if self.portal_membership.checkPermission('View', > o)] > return objs > - > \ No newline at end of file > + This isn't really a correct solution, because the 'view' action *should not* need to use /view. That is, there should be a (Default) alias that points to 'referencemanualpage_view', which should be the first thing that's checked. Most content types do not have a 'view' action that includes /view, so there must be something else wrong.... > I'll submit it as an issue as soon as "Submit issue" at plone.org > doesn't raise Insufficient privileges anymore .. Huh? Where is that? Martin |