[Zope-Coders] PROBLEM: KeywordIndex and Zope2.6.2
Tres Seaver
tseaver at zope.com
Thu Sep 25 16:11:39 EDT 2003
On Thu, 2003-09-25 at 15:58, alan runyan wrote:
> Hi.
>
> It seems that there is a problem with the KeywordIndex
> with Zope2.6.2 (but its been there for awhile I believe?).
>
> In KeyWordIndex._get_object_keywords(obj) we have
> newKeywords = getattr(obj, self.id, ())
>
> it seems obj has a acquisition context so it will
> fetch the id from the object or acquire it. This
> is incorrect I believe.
>
> I had a client who has a KeywordIndex 'Curriculum'
> and had a PortalFolder in the root of their CMF
> with the id 'Curriculum' and all hell broke loose.
>
> That is What Happened.
>
> Now since we have PluginIndexes I would think that
> the cataloging machinery would strip the acquisition
> context from the objects before passing it to its
> Indexers. Is this the case?
No. I know of several applications which leverage exactly the behavior
you object to (which is common to *all* indexes). For instance, I often
add a PythonScript at the root of the site (or in the 'custom' folder)
which uses business logic to compute the value to be indexed.
> If so it didnt work
> for my client. This would make sense and I havent
> read up on the code whether or not it should work
> in that manner.
>
> We put this in the collector and stephan holek found
> another bug regarding acl_users (I forgot what it was)
> and it should also be in the collector.
It should be trivial to write an acquistion-stripping plugin index, and
use that instead of the default indices.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope-Coders
mailing list