z3c.contents failure (was Re: Zope Tests: 41 OK, 13 Failed)
Marius Gedminas <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel |
|---|---|
| Message-ID | <20101219192609.GA9158@platonas> |
On Sun, Dec 19, 2010 at 08:09:21PM +0200, Marius Gedminas wrote: > I was curious what a TemplateFactory adapter was doing in the _local_ > site, and then discovered that it was being registered inside > z3c.contents README.txt, via xmlconfig.string(). > > Apparently this worked just fine when ZCML directives used > getGlobalSiteManager() for their components, but now they use > getSiteManager() and you end up with nonpersistable adapters like > z3c.template's TemplateFactory in the local site. > > I can get rid of the TypeError with this patch, (which does setSite(None) before xmlconfig.string(), and then restores the real site) > but then the tests fail > because the search form is missing from the rendered HTML (why???): they fail because ContentsPage.template looks up the wrong template -- z3c.formui's div-form.pt, instead of our contents.pt, registered explicitly for IContentsPage. How very curious. Looking at [a for a in getSiteManager().registeredAdapters() if a.provided == IContentTemplate and a.name == ''] and [a for a in getGlobalSiteManager().registeredAdapters() if a.provided == IContentTemplate and a.name == ''] I see that formui's div-form.pt is provided in the local site, while our contents.pt is provided in the global site (after my change). Looking closer at README.txt I see that there's more than one invocation of xmlconfig. I've wrapped them all in setSite(None) and the tests pass. (Nevertheless, the zope.copy bug should be fixed as well.) Marius Gedminas -- http://pov.lt/ -- Zope 3/BlueBream consulting and development _______________________________________________ Zope-Dev maillist - [email protected] https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk0OXFEACgkQkVdEXeem14/TwwCfX7xZpZOBs586iBGRDTAbuMGE H80Anjo+4ZSJyui2j1VD8sH186ouvp4Q =dSNJ -----END PGP SIGNATURE-----