[Zope-CMF] Re: CMF 2.0 sandboxes

Philipp von Weitershausen philipp at weitershausen.de
Thu Nov 17 13:25:32 EST 2005


Tres Seaver wrote:
> Tres Seaver wrote:
> 
>>>yuppie wrote:
>>>
>>>
>>>
>>>>>Florent Guillaume wrote:
>>>>>
>>>>>
>>>>>
>>>>>>In what environement do people playing with CMF 2.0 (trunk) work ?
>>>>>>Because when used with Zope 2 trunk, there are many failing unit tests.
>>>>>
>>>>>
>>>>>My CMF 2.0 sandbox uses Zope 2.8.4 with Five 1.2. All tests pass on that
>>>>>platform. I tried it once with Zope 2 trunk and also saw many failing
>>>>>unit tests:
>>>>>
>>>>>1.) The 'default' layer is no longer available by default. That breaks
>>>>>everything that depends on ZCML configuration. Removing it in
>>>>>skin/configure.zcml 'fixes' most tests.
>>>
>>>
>>>I don't know why that layer is gone on the trunk.  It seems like a
>>>needless BBB party foul.
> 
> 
> The following ZCML imports get the default layer in place for 2.9, but
> cause things to blow up on 2.8:
> 
> $ svn diff
> Index: CMFDefault/skin/configure.zcml
> ===================================================================
> --- CMFDefault/skin/configure.zcml      (revision 40195)
> +++ CMFDefault/skin/configure.zcml      (working copy)
> @@ -8,6 +8,10 @@
>        />
> 
>    <!-- 'default' layer breaks when run under 2.9! -->
> +  <include package="zope.app.component" file="meta.zcml" />
> +  <include package="zope.app.security" file="meta.zcml" />
> +  <include package="zope.app.security" />
> +  <include package="zope.app.publisher.browser" />
>    <browser:skin
>        name="cmf"
>        layers="cmf default"
> 
> 
> Phillip, do you have a clue why Five's ZCML initialization order has
> changed, such that the product ZCML is being done before the core zope3
> stuff?

I think I know what's wrong. We're missing some important registrations
of the default layer. I *think* we need the following declarations to be
executed in Five.browser/configure.zcml:

<interface
  interface="zope.publisher.interfaces.browser.ILayer" />

<interface
  interface="zope.publisher.interfaces.browser.ISkin" />

<interface
  interface="zope.app.publisher.interfaces.browser.IMenuItemType" />

<defaultLayer
  type="zope.publisher.interfaces.browser.IBrowserRequest"
  layer="zope.publisher.interfaces.browser.IDefaultBrowserLayer" />

<browser:layer name="default"
  interface="zope.publisher.interfaces.browser.IDefaultBrowserLayer" />


For that to work, we also need the 'defaultLayer' directive to be
configured. I will try to fix this tomorrow, issue a 1.3b3 and include
it into the Zope trunk. If anything else ain't working after that, my
biggest suspicition would be the reason described in
http://article.gmane.org/gmane.comp.web.zope.cmf/11066.

G'night from Shanghai,

Philipp


More information about the Zope-CMF mailing list