Warning

This document hasn't been checked for compatibility with current versions of Plone. Use at your own risk.

AttributeError: 'NoneType' object has no attribute 'keys'

by Alex Limi last modified Dec 30, 2008 03:08 PM
I got this error when switching between OrderedBaseFolder and a BTree-based equivalent in Archetypes, the actual error can be a lot of things, but thought I would document this particular instance of it here.

This error message can show up when you switch a OrderedBaseFolder-based container in an Archetypes type to a BTree-based one (BaseBTreeFolder), and try to reinstall the product with an existing non-BTree based instance still in the portal.

The solution is to remove the existing instance, and create a clean one after installing the product. There is surely some way to get the old content over, but I don't know how to do that. ;)

A sample traceback of what you could be seeing on install:

  File "/Plone/Products/CMFCore/WorkflowTool.py", 
  line 669, in _recursiveUpdateRoleMappings
    obs = ob.objectItems()

  File "/Plone/Products/BTreeFolder2/BTreeFolder2.py", 
  line 369, in objectItems
    self.objectIds(spec))

  File "/Plone/Products/BTreeFolder2/BTreeFolder2.py", 
  line 350, in objectIds
    return self._tree.keys()

  AttributeError: 'NoneType' object has no attribute 'keys'