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

Dan Korostelev nadako at gmail.com
Sat Feb 28 01:32:22 EST 2009


2009/2/28 Jens W. Klein <jens at bluedynamics.com>:
> 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.

Well, it should be set to global site manager instead of empty tuple,
but it's basically like that :) I've fixed that in the trunk.

Thanks for the report!

-- 
WBR, Dan Korostelev


More information about the Zope3-users mailing list