Raphael Ritz | 14 Dec 15:24
Favicon

Re: Will migration ever work? -update

Nick Davis wrote:
[..]
> One may ask why Plone 2.0RCx to Plone 2.0.3 added folders with missing 
> attributes. This may also be the cause of all these "some folders don't 
> work" problems. I shall continue investigating.............
> 

I didn't really follow this thread but here is how I
fixed this (or a similar issue) in one of my sites:

put this in a file to be executed via 'zopectrl run'

site = app[<your plone id>]
tt = site['portal_types']
atct = site['portal_atct']

broken_folders = <something that returns a list of pathes
                   to your broken folders, e.g., all folders
                   that have no portal type>

mlog = <my custom logger>

for folder in broken_folders:
     mlog("Fixing '%s'" % folder)
     f = site.unrestrictedTraverse(folder)
     tt['CMF Folder']._finishConstruction(f)
atct.migrateContentTypesToATCT()
for folder in broken_folders:
     f = site.unrestrictedTraverse(folder)
     f.reindexObject()

and don't forget to commit when you are done.

HTH,

	Raphael


Gmane