-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
plone.app.portlets.portlets.navigation.Assignment
used to following code to migrate from the old toot
field to the new root_uid
field:
def _root(self):
# This is only called if the instance doesn't have a root_uid
# attribute, which is probably because it has an old 'root'
# attribute that needs to be converted.
root = self.root
if not root:
return None
portal = getToolByName(self, 'portal_url').getPortalObject()
navroot = getNavigationRootObject(self, portal)
try:
root = navroot.unrestrictedTraverse(root.lstrip('/'))
except (AttributeError, KeyError, TypeError, NotFound):
return
return root.UID()
root_uid = ComputedAttribute(_root, 1)
This code fails (to determine the correct root) because getNavigationRootObject
returns the portlet assignemt mapping (the parent of the portlet assignment) and nothing fit to perform a tracersal.
Metadata
Metadata
Assignees
Labels
No labels