diff --git a/src/collective/exportimport/export_other.py b/src/collective/exportimport/export_other.py index bc85da41..2e9fdd80 100644 --- a/src/collective/exportimport/export_other.py +++ b/src/collective/exportimport/export_other.py @@ -639,12 +639,16 @@ def all_portlets(self): self.results = [] portal = api.portal.get() portal.ZopeFindAndApply(self.context, search_sub=True, apply_func=self.get_portlets) + self.get_root_portlets() return self.results - def get_portlets(self,obj, path): + def get_portlets(self, obj, path): uid = IUUID(obj, None) if not uid: return + self._get_portlets(obj, uid) + + def _get_portlets(self, obj): portlets = export_local_portlets(obj) blacklist = export_portlets_blacklist(obj) portlets = self.local_portlets_hook(portlets) @@ -659,6 +663,11 @@ def get_portlets(self,obj, path): obj_results["uuid"] = uid self.results.append(obj_results) return + + def get_root_portlets(self): + site = api.portal.get() + self._get_portlets(site, PORTAL_PLACEHOLDER) + return def local_portlets_hook(self, portlets): return portlets diff --git a/src/collective/exportimport/import_other.py b/src/collective/exportimport/import_other.py index bea42f5f..fd7d29a0 100644 --- a/src/collective/exportimport/import_other.py +++ b/src/collective/exportimport/import_other.py @@ -700,7 +700,8 @@ def import_portlets(self, data): for item in data: obj = api.content.get(UID=item["uuid"]) if not obj: - continue + if item["uuid"] == PORTAL_PLACEHOLDER: + obj = api.portal.get() registered_portlets = register_portlets(obj, item) results += registered_portlets return results