[Zope] Warning: TextIndexNG 1.07 corrups your objects if you have casefolding on

Heimo Laukkanen huima@fountainpark.org
Mon, 06 Jan 2003 04:59:28 +0200


Hi ya,

this is a very strange bug that I my collegue found, I hunted down that 
TextIndexNG is the cause for it.

Short description:
When TextIndexNG is used and case folding is on, TextIndexNG seems to 
corrupt the object - ie. putting the case folded content to the object 
that it indexed!

Below is my story.

Situation:

Site with propertyObjects, propertyFolders and ZCatalog that has 
TextIndexNG fields. Some propertyObjects / folders have a field called 
content, which is uText of type and is indexed into TextIndexNG.

If in TextIndexNG we have case folding turned on, then after we save 
changes to propertyObject/Folder ( and object indexes itself automaticly 
to Catalog ) the content in content-field loses it's case. And if we 
turn off the case folding, then casing stays. In TextIndexNG it does not 
matter, wether the id for index is content or something else - as long 
as content-attribute is indexed.

I didn't look into TextIndexNG code, but I assume that somewhere there 
is a bug that takes the object attribute instead of just the value of 
it, and thisway also screws up the object. This was really evil bug, 
since it was hard to get - and when we saw it - then it had allready 
corrupted a lot of files that had content.

-huima