Skip to content
Permalink
Browse files

Make it possible to delete broken portlet assignment.

  • Loading branch information...
vipod committed Feb 23, 2013
1 parent 24037f8 commit f69fb3ff9133a281233ee06fc14fcc317fb8bc33
Showing with 14 additions and 0 deletions.
  1. +3 −0 CHANGES.rst
  2. +11 −0 plone/app/portlets/browser/editmanager.py
@@ -4,6 +4,9 @@ Changelog
2.4.2 (unreleased)
------------------

- Make it possible to delete broken portlet assignment.
[vipod]

- Make sure a portlet name is not a unicode string. This prevents problems when
trying to use a portlet name in joined strings.
[wichert]
@@ -12,6 +12,7 @@
from plone.portlets.utils import hashPortletInfo
from plone.portlets.utils import unhashPortletInfo

from zope.container import contained
from zope.interface import implements, Interface
from zope.component import adapts, getMultiAdapter, queryMultiAdapter, queryAdapter, getUtility
from zope.contentprovider.interfaces import UpdateNotCalled
@@ -403,7 +404,17 @@ def delete_portlet(self, name):
self.authorize()
assignments = aq_inner(self.context)
IPortletPermissionChecker(assignments)()

# set fixing_up to True to let zope.container.contained
# know that our object doesn't have __name__ and __parent__
fixing_up = contained.fixing_up
contained.fixing_up = True

del assignments[name]

# revert our fixing_up customization
contained.fixing_up = fixing_up

return self.finish_portlet_change()

def _nextUrl(self):

3 comments on commit f69fb3f

@mister-roboto

This comment has been minimized.

Copy link

replied Feb 23, 2013

Testing:

@mister-roboto

This comment has been minimized.

Copy link

replied Feb 23, 2013

Testing:

@davilima6

This comment has been minimized.

Copy link
Member

replied Feb 24, 2013

Please sign in to comment.
You can’t perform that action at this time.