-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maurits van Rees wrote:
Hi,
In some test code I add a custom content type called School. Then I check if it has been added to the portal catalog. And I call a function in a PAS plugin that searches for a School within the catalog and does something with that. This all works. Tests pass. I am happy.
But in practice it somehow does not work. In the portal_catalog within the ZMI I can clearly see that a School is present in the catalog. But the code in my PAS plugin does not find it. And in a zopectl debug session I also cannot find it.
Here is some code I use. Product is another custom content type.
cat = getToolByName(self, 'portal_catalog') assert(len(cat()) > 5) assert(len(cat(portal_type='Product')) > 5) assert(len(cat(portal_type='School')) > 0)
The first two assertions pass, so the catalog seems to be functioning properly. The last assertion fails.
Can anyone think of a reason why this could happen? Should I add some more parameters to the catalog call? Should I use searchResults instead, or queryCatalog?
This is on Plone 3.0 btw, with Zope 2.10.5. CMFPlone overwrites the default CatalogTool from zope, so I thought about asking on a plone list instead. But since it *does* go correct in the tests I thought it was probably not something Plone specific. Feel free to direct me to a different list though. :)
Thanks,
One of the overrides in the CMF catalog tool (and inherited in the Plone version, AFAIK) is filtering out content which the user wouldn't be permitted to view if she did find it. Are you sure that your School object is in an appropriate workflow state for the user to find? You should be able to look at the content of the catalog (on its "Catalog" tab) and find your School object. Look at the content of the 'allowedRolesAndUsers' index for that object: does it say something like '("Manager",)"? Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHThDK+gerLs4ltQ4RAoNtAJwLo8tICHhuL793Z6ir2T4yi1gzCgCgzbsv gUCky9XPF3QEfmMXkBNhqTY= =U7Xd -----END PGP SIGNATURE-----