[ZCM] [ZC] 2299/ 5 Reject "TextIndex error on multi-line code examples"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]> Sat, 24 Mar 2007 21:10:54 -0400
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2299 Update (Reject) "TextIndex error on multi-line code examples"
Status Rejected, Catalog/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/2299
==============================================================
= Reject - Entry #5 by tseaver on Mar 24, 2007 9:10 pm
Status: Pending => Rejected
I looked at CMFPlone/skins/plone_scripts/getFolderContents.py,
which is the culprit here: it assumes that the request's form
can be used to derive a 'content_filter' if none is passed.
However, in the case posted on the Plone ticket, 'getFolderContents'
is being called indirectly while returning a template after doing
the content update; in that case, the form variables are *not*
intended to form a search query.
I followed up to the Plone ticket with this info.
________________________________________
= Comment - Entry #4 by limi on Mar 24, 2007 9:06 pm
> The 'quotes' function is only called while parsing a query
> against the index, never while indexing a piece of content.
OK, thanks.
> Second, why are you using a TextIndex at all, rather than
> a ZCTextIndex?
I have no idea. I just checked the portal_catalog in a standard Plone site, and we only have ZCTextIndexes there.
I guess I'll have to get somebody to do some more digging here, feel free to close this issue.
________________________________________
= Comment - Entry #3 by tseaver on Mar 24, 2007 8:57 pm
First, the traceback shown in that issue is for an error in the *search string*, not while indexing the body text::
Module Products.PluginIndexes?.TextIndex?.TextIndex?, line 490, in _apply_index
Module Products.PluginIndexes?.TextIndex?.TextIndex?, line 547, in query
Module Products.PluginIndexes?.TextIndex?.TextIndex?, line 668, in parse
Module Products.PluginIndexes?.TextIndex?.TextIndex?, line 732, in quotes
The 'quotes' function is only called while parsing a query
against the index, never while indexing a piece of content.
I verified this by creating and searching a TextIndex using
a DTMLDocument containing the string you supplied: because
my search terms did not contain quotes, I had no problems.
Second, why are you using a TextIndex at all, rather than
a ZCTextIndex?
________________________________________
= Comment - Entry #2 by limi on Mar 24, 2007 6:49 pm
Forgot the original version info, sorry:
Zope version: (Zope 2.9.4-final, python 2.4.3, linux2)
________________________________________
= Request - Entry #1 by limi on Mar 24, 2007 6:48 pm
>From http://dev.plone.org/plone/ticket/5990
"""
When I place this in a <pre/> tag and save, Zope is fine with it:
<pre>tal:condition="results"</pre>
However, when I do a multi-line <pre/> tag, which contains quotes spread out on different lines, line this one:
<pre>tal:condition="python:test(not site_properties.allowAnonymousView
and site_properties.portal_membership.isAnonymousUser(), 0, 1)"</pre>
... Zope breaks on saving the file with the error TextIndex.QueryError: Mismatched quotes.
"""
Full traceback is available at http://dev.plone.org/plone/ticket/5990
==============================================================