Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceback when searching for text with parentheses #60

Open
laulaz opened this issue Feb 7, 2023 · 2 comments
Open

Traceback when searching for text with parentheses #60

laulaz opened this issue Feb 7, 2023 · 2 comments

Comments

@laulaz
Copy link
Member

laulaz commented Feb 7, 2023

For example, with a search term : "(my text)", you get the following traceback :

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module zope.formlib.form, line 873, in __call__
  Module zope.formlib.form, line 994, in render
  Module zope.formlib.form, line 863, in render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 946, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /plone/eggs/collective.searchandreplace-8.2.1-py2.7.egg/collective/searchandreplace/browser/pageform.pt
   - Line 115, Column 16
   - Expression: <PathExpr standard:u'context/@@searchreplacetable'>
   - Names:
      {'args': (),
       'container': <PloneSite at /Plone>,
       'context': <PloneSite at /Plone>,
       'default': <object object at 0x7febb211a570>,
       'here': <PloneSite at /Plone>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7feb99c7f890>,
       'request': <HTTPRequest, URL=http://www.cirb.irisnetlab.be/@@searchreplaceform>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7feb9c1ee5d0>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SearchReplaceForm object at 0x7feb9b10f990>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7feb97e09d90>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 94, in trustedBoboAwareZopeTraverse
  Module OFS.Traversable, line 201, in unrestrictedTraverse
   - __traceback_info__: ([], '@@searchreplacetable')
  Module zope.traversing.namespace, line 112, in namespaceLookup
  Module Products.CMFPlone.patches.security, line 12, in traverse
  Module zope.traversing.namespace, line 327, in traverse
  Module zope.component._api, line 120, in queryMultiAdapter
  Module zope.component.registry, line 238, in queryMultiAdapter
  Module zope.interface.adapter, line 532, in queryMultiAdapter
  Module collective.searchandreplace.browser.searchreplacetable, line 19, in __init__
  Module collective.searchandreplace.browser.searchreplacetable, line 49, in findObjects
  Module collective.searchandreplace.searchreplaceutility, line 191, in findObjects
  Module Products.LinguaPlone.patches, line 34, in searchResults
  Module Products.CMFPlone.CatalogTool, line 393, in searchResults
  Module Products.ZCatalog.ZCatalog, line 604, in searchResults
  Module Products.ZCatalog.Catalog, line 925, in searchResults
  Module Products.ZCatalog.Catalog, line 547, in search
  Module Products.ZCTextIndex.ZCTextIndex, line 217, in _apply_index
  Module Products.ZCTextIndex.QueryParser, line 136, in parseQuery
  Module Products.ZCTextIndex.QueryParser, line 156, in _require
ParseError: Token 'EOF' required, u'(' found

Tested on Plone 5 / collective.searchandreplace 8.2.1.

@mauritsvanrees
Copy link
Member

I think this used to fail on the default search form in Plone as well. Works fine now in a quick test in the Plone coredev buildout on 5.2 (Py 2.7) and 6.0.

If this was really fixed, I would expect a changelog entry in Products.CMFPlone or Products.ZCatalog, but I cannot find one that matches. Could be worth a try to update to the latest Plone 5.2 though, if you have not done so yet. This is on 5.2, right?

But I see Products.LinguaPlone.patches in the traceback. That product should not be used anymore. Maybe its patch is outdated.

@laulaz
Copy link
Member Author

laulaz commented Apr 27, 2023

@mauritsvanrees tested it again on Plone 5.2.12 on a fresh instance (no LinguaPlone anymore). Got the same error.

Here is the full traceback
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 280, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module zope.formlib.form, line 901, in __call__
  Module zope.formlib.form, line 1024, in render
  Module zope.formlib.form, line 891, in render
  Module Products.Five.browser.pagetemplatefile, line 126, in __call__
  Module Products.Five.browser.pagetemplatefile, line 58, in __call__
  Module zope.pagetemplate.pagetemplate, line 133, in pt_render
  Module Products.PageTemplates.engine, line 378, in __call__
  Module z3c.pt.pagetemplate, line 176, in render
  Module chameleon.zpt.template, line 302, in render
  Module chameleon.template, line 215, in render
  Module chameleon.utils, line 53, in raise_with_traceback
  Module chameleon.template, line 192, in render
  Module 7aed9a750eaf2246611d7b92229efd45, line 1838, in render
  Module 1a222127667e34cfcba1bed14bd144a3, line 860, in render_master
  Module 1a222127667e34cfcba1bed14bd144a3, line 1526, in render_content
  Module 7aed9a750eaf2246611d7b92229efd45, line 1823, in __fill_main
  Module 7aed9a750eaf2246611d7b92229efd45, line 559, in render_form
  Module 7aed9a750eaf2246611d7b92229efd45, line 892, in render_master
  Module zope.tales.expressions, line 250, in __call__
  Module Products.PageTemplates.Expressions, line 217, in _eval
  Module zope.tales.expressions, line 153, in _eval
  Module Products.PageTemplates.Expressions, line 131, in trustedBoboAwareZopeTraverse
  Module OFS.Traversable, line 232, in unrestrictedTraverse
   - __traceback_info__: ([], '@@searchreplacetable')
  Module zope.traversing.namespace, line 165, in namespaceLookup
  Module Products.CMFPlone.earlypatches.security, line 15, in traverse
  Module zope.traversing.namespace, line 418, in traverse
  Module zope.component._api, line 116, in queryMultiAdapter
  Module zope.interface.registry, line 364, in queryMultiAdapter
  Module zope.interface.adapter, line 844, in queryMultiAdapter
  Module collective.searchandreplace.browser.searchreplacetable, line 19, in __init__
  Module collective.searchandreplace.browser.searchreplacetable, line 43, in findObjects
  Module collective.searchandreplace.searchreplaceutility, line 194, in findObjects
  Module Products.CMFPlone.CatalogTool, line 468, in searchResults
  Module Products.ZCatalog.ZCatalog, line 627, in searchResults
  Module Products.ZCatalog.Catalog, line 1094, in searchResults
  Module Products.ZCatalog.Catalog, line 637, in search
  Module Products.ZCatalog.Catalog, line 567, in _search_index
  Module Products.ZCTextIndex.ZCTextIndex, line 209, in query_index
  Module Products.ZCTextIndex.QueryParser, line 155, in parseQuery
  Module Products.ZCTextIndex.QueryParser, line 175, in _require
Products.ZCTextIndex.ParseTree.ParseError: Products.ZCTextIndex.ParseTree.ParseError: Token <Token:EOF> required, '(' found

 - Expression: "context/@@searchreplacetable"
 - Filename:   ... dreplace/collective/searchandreplace/browser/pageform.pt
 - Location:   (line 116: col 41)
 - Source:     ... replace="structure context/@@searchreplacetable"
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Expression: "context/main_template/macros/master"
 - Filename:   ... dreplace/collective/searchandreplace/browser/pageform.pt
 - Location:   (line 6: col 19)
 - Source:     ... etal:use-macro="context/main_template/macros/master"
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x110393790>
               options: {}
               args: ()
               nothing: None
               modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x10a7cd610>
               request: <WSGIRequest, URL=http://localhost:8080/Plone/@@searchreplaceform>
               view: <Products.Five.browser.metaconfigure.SearchReplaceForm object at 0x11131b190>
               context: <PloneSite at /Plone>
               views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x11439f3d0>
               here: <PloneSite at /Plone>
               container: <PloneSite at /Plone>
               root: <Application at >
               traverse_subpath: []
               user: <PropertiedUser 'admin'>
               default: <DEFAULT>
               repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x110db7680>
               loop: {}
               target_language: None
               translate: <function BaseTemplate.render.<locals>.translate at 0x114731430>
               macroname: 'master'
               attrs: {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants