[Zope3-Users] problem adding localsitemanager in a subscriber with 3.5dev KGS

Jens W. Klein jens at bluedynamics.com
Fri Feb 27 16:48:01 EST 2009


Am Sat, 28 Feb 2009 00:28:38 +0300 schrieb Dan Korostelev:
[...]
> It assumes that the root folder has its own component registry, but the
> rootFolder factory doesn't create one, so it returns none as the next
> site manager. So, you need to call setSiteManager for the root folder
> after creating it. 

indeed!

  >>> from site import MySite
  >>> mysite = MySite()
  >>> from zope.app.folder import rootFolder 
  >>> root = rootFolder()
  >>> root.setSiteManager(LocalSiteManager(root))
  >>> root[u'mysite'] = mysite

works fine!

> However, I guess this case should be handled by
> zope.site's event handler. I'll take a look at that tomorrow.

changing the assignment in 
zope.site.site.changeSiteConfigurationAfterMove (line 254) to

	site.getSiteManager().__bases__ = (next, ) if next else ()

should do it. 

Thanks a lot
-- 
Jens W. Klein, BlueDynamics Alliance, http://bluedynamics.com



More information about the Zope3-users mailing list