collective.exportimport
collective.exportimport copied to clipboard
Unhandled exception in get_default_page()
For some custom content object, get_default_page() raises:
File "/home/ajung/sandboxes/iwm/plone4.buildout/src/collective.exportimport/src/collective/exportimport/export_other.py", line 466, in get_default_page
default_page = obj.getDefaultPage()
File "/home/ajung/.buildout/eggs/Products.CMFDynamicViewFTI-4.1.8-py2.7.egg/Products/CMFDynamicViewFTI/browserdefault.py", line 88, in getDefaultPage
return plone_utils.getDefaultPage(self)
File "/home/ajung/.buildout/eggs/Products.CMFPlone-4.3.20-py2.7.egg/Products/CMFPlone/PloneTool.py", line 701, in getDefaultPage
return utils.getDefaultPage(obj, request)
File "/home/ajung/.buildout/eggs/Products.CMFPlone-4.3.20-py2.7.egg/Products/CMFPlone/utils.py", line 113, in getDefaultPage
return view.getDefaultPage()
File "/home/ajung/.buildout/eggs/plone.app.layout-2.3.20-py2.7.egg/plone/app/layout/navigation/defaultpage.py", line 32, in getDefaultPage
return getDefaultPage(aq_inner(self.context))
File "/home/ajung/.buildout/eggs/plone.app.layout-2.3.20-py2.7.egg/plone/app/layout/navigation/defaultpage.py", line 76, in getDefaultPage
if 'index_html' in ids:
File "/home/ajung/.buildout/eggs/plone.folder-1.0.12-py2.7.egg/plone/folder/ordered.py", line 209, in __contains__
return key in self._tree
TypeError: argument of type 'NoneType' is not iterable
Workaround: catch the exception and assign default_page = None
I will also change the data for default-pages to use uuids so it will still work if the default page changes the id during import.