'str' object is not callable error in find option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When you are searching something which does not exist in the site, it lounches an error like this:
Time 2008/06/04 12:58:47.073 GMT+2
User Name (User Id) xxxx(xxxx)
Request URL http://
Exception Type TypeError
Exception Value 'str' object is not callable
Traceback (innermost last):
* Module ZPublisher.Publish, line 119, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 42, in call_object
* Module Shared.
* Module Shared.
* Module App.special_dtml, line 178, in _exec
* Module DocumentTemplat
* Module DocumentTemplat
_
* Module <string>, line 0, in ?
* Module OFS.FindSupport, line 163, in ZopeFind
* Module OFS.FindSupport, line 163, in ZopeFind
* Module OFS.FindSupport, line 124, in ZopeFind
TypeError: 'str' object is not callable
Display traceback as text
I find that most of my zope site's are unsearchable with the find option - it only takes one file in the system from one product to prevent searching ever working again, and the exception thrown usually gives no clue as to where the error is. I've written a little hack to /lib/python/ OFS/FindSupport .py that adds a try-except around the search, so that the search can still proceed.
It marks the pages that cause errors as found in the search, but adds "Error Searching: " to their ID. This is useful for spotting the problem, but breaks the link in the results, so it needs polishing up. The patch is attached.