A bug in the moderator panel meant you couldn't delete items in a virtual host, if your portal was named "plone".

svn path=/plone.app.discussion/trunk/; revision=35608
This commit is contained in:
Lennart Regebro 2010-04-01 13:48:03 +00:00
parent f7c676622b
commit 30c66b0b24
3 changed files with 14 additions and 1 deletions

View File

@ -54,6 +54,9 @@ Changelog
* Added greek translation. * Added greek translation.
[ggozad] [ggozad]
* A bug in the moderator panel meant you couldn't delete items in a virtual
host, if your portal was named "plone".
[regebro]
1.0b3 (2010-01-28) 1.0b3 (2010-01-28)
------------------ ------------------

View File

@ -91,7 +91,7 @@
class="noborder" class="noborder"
name="paths:list" id="#" name="paths:list" id="#"
value="#" value="#"
tal:attributes="value item/getPath; tal:attributes="value python:view.item_path(item);
id string:cb_${item/id}; id string:cb_${item/id};
checked item/checked|nothing; checked item/checked|nothing;
alt string:Select ${item/Title}; alt string:Select ${item/Title};

View File

@ -44,6 +44,11 @@ class View(BrowserView):
self.request.set('disable_border', True) self.request.set('disable_border', True)
context = aq_inner(self.context) context = aq_inner(self.context)
# Help for path mangling
portal_url = getToolByName(context, 'portal_url')
self.portal_url = portal_url()
self.portal_path = portal_url.getPortalPath()
catalog = getToolByName(context, 'portal_catalog') catalog = getToolByName(context, 'portal_catalog')
@ -67,6 +72,11 @@ class View(BrowserView):
return True return True
else: else:
return False return False
def item_path(self, item):
# Path mangling to support virtual hosting
path = item.getPath()[len(self.portal_path):]
return self.portal_url + path
class DeleteComment(BrowserView): class DeleteComment(BrowserView):