2.1.x -> 2.5.2: Error value: 'NoneType' object has no attribute 'addMember'

by Bryan White last modified Dec 30, 2008 03:08 PM

When Migrating from 2.1.3 or 2.1.4 to 2.5.2, some Plone instances may raise the error: Error value: 'NoneType' object has no attribute 'addMember'

I can't take credit for the solution on this one, it was found in the tracker: http://plone.org/products/plonepas/issues/29

Solution:

At line 387 of PlonePAS/Extensions/Install.py (version that ships with Plone 2.5.2) add the conditional emphasized below.

# restore group memberships
gid = g[0]
group = gtool.getGroupById(gid)
if group is not None:
    for mid in groupmemberships[gid]:
        group.addMember(mid)
        print >> out, "%s " % mid

I have encountered the problem more than once, though, so I think the error belongs in the reference.