Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception in get_default_page() #114

Open
zopyx opened this issue Apr 14, 2022 · 1 comment
Open

Unhandled exception in get_default_page() #114

zopyx opened this issue Apr 14, 2022 · 1 comment
Assignees

Comments

@zopyx
Copy link
Contributor

zopyx commented Apr 14, 2022

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

@pbauer pbauer self-assigned this Apr 14, 2022
@pbauer
Copy link
Member

pbauer commented Apr 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants