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.
[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)
------------------

View File

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

View File

@ -45,6 +45,11 @@ class View(BrowserView):
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')
self.comments = catalog(object_provides=IComment.__identifier__,
@ -68,6 +73,11 @@ class View(BrowserView):
else:
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):
"""Delete a comment from a conversation