Bug in LinguaPlone
Tiberiu Ichim
tibi at life.org.ro
Mon Jun 11 19:46:32 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I've found a bug in LinguaPlone and unfortunately I'm not able to add it
to its tracker on plone.org because of some error (which prevents me
also from signing up, also).
I thought I'll highlight it here, maybe someone will pick it up.
Basically, I couldn't install LinguaPlone when remember is installed. I
got the following traceback:
http://paste.plone.org/15079 (attached at the bottom also).
Tracing the code revealed that the wrapped object that is retrieved from
the object to be indexed behaves in weird ways when involved in logic
operations. For example:
>>> wrapped or None
>>> wrapped
<MemberDataContainer at /t5/portal_memberdata>
My proposed patch is this (sorry, no tests for now):
Index: LanguageIndex.py
===================================================================
- --- LanguageIndex.py (revision 15295)
+++ LanguageIndex.py (working copy)
@@ -119,14 +119,15 @@
if not ITranslatable.isImplementedBy(obj):
if IndexableObjectWrapper.isImplementedBy(obj):
# Wrapper doesn't proxy __implements__
- - wrapped = getattr(obj, '_IndexableObjectWrapper__ob',
None)
- - # Older CMFPlone
- - wrapped = wrapped or getattr(obj, '_obj', None)
- - if wrapped and not
ITranslatable.isImplementedBy(wrapped):
+ wrapped = getattr(obj, '_IndexableObjectWrapper__ob',
+ #dealing with older CMFPlone
+ getattr(obj, '_obj', None))
+ if wrapped is None:
+ return 0
+ if (wrapped is not None) and not
ITranslatable.isImplementedBy(wrapped):
return 0
else:
return 0
- -
language = obj.Language()
cid = obj.getCanonical().UID()
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGbaaXIBSF7cMuLLURAgbCAKChCqum4EQbqVa8y2Tse7KTLqFUXgCfVBFh
pL859/Yee4h9/kK7Cr6hKiU=
=vmiH
-----END PGP SIGNATURE-----
More information about the Product-Developers
mailing list