Open d-maurer opened 4 years ago
In addition: when the Assignment
is retrieved by the PortletManagerRetriever
, it is not acquisition wrapped. ComputedAttribute(..., 1)
requires at least one level of acquisition wrapping to work. This implies that the migration code does not work at all during normal operation.
I think using the getNavigationRoot function instead of getNavigationRootObject could work. The getNavigationRoot function returns the navigation root object, whereas getNavigationRootObject returns the portlet assignment mapping. Also we could try wrapping the assignment in an acquisition wrapper before passing it to the ComputedAttribute function
plone.app.portlets.portlets.navigation.Assignment
used to following code to migrate from the oldtoot
field to the newroot_uid
field: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.