zopefoundation / Products.ZCatalog

Zope's indexing and search solution.
Other
5 stars 22 forks source link

Avoid error in search when the parameter received by IndexQuery is a record #129

Closed wesleybl closed 2 years ago

wesleybl commented 2 years ago

When using record notation in URL parameters, for example:

http://localhost:8080/Plone/@@search?end.query:record:list:date=2022-2-2+00%3A00%3A00&end.range:record=min

On the Zope side, this parameter becomes a ZPublisher.HTTPRequest.record, not a dictionary.

However, IndexQuery only expected the parameter to be a dictionary. When the parameter is a record and it is not considered when extracting the query key, the error occurs:

TypeError: unailshable type: 'record'

in search.

Now we consider that the parameter can be a record as well.

Fixes plone/Products.CMFPlone#3007

ale-rt commented 2 years ago

Congratulations @wesleybl :) Your first PR for the zopefoundation has been approved. The rule for the zopefoundation repos is that once the PR is approved, the author merges it. So you are welcome to push the green button :)

wesleybl commented 2 years ago

Thanks @ale-rt !

Done merge.