[Zope-CMF] CMF 1.1 bug with catalog ?
Tres Seaver
tseaver@palladion.com
Mon, 13 Aug 2001 21:36:02 -0400
Florent Guillaume wrote:
> I have a bug that I can't reproduce on cmf.zope.org, so maybe is it
> already fixed ? Here it is anyway:
>
> In a CMF 1.1, using the "Metadata" form, change the title of a document
> to read:
> foo ...
> That is, foo space dot dot dot.
>
> An exception is raised:
>
> ... snipped ...
> File /home/zope/zopesig/lib/python/DocumentTemplate/DT_Util.py, line 339, in eval
> (Object: portal_actions.listFilteredActionsFor(obj))
> (Info: portal_actions)
> File <string>, line 0, in ?
> File /home/zope/zopesig/lib/python/Products/CMFCore/ActionsTool.py, line 190, in listFilteredActionsFor
> (Object: portal_actions)
> File /home/zope/zopesig/lib/python/Products/CMFCore/WorkflowTool.py, line 442, in listActions
> (Object: Traversable)
> File /home/zope/zopesig/lib/python/Products/DCWorkflow/DCWorkflow.py, line 306, in listGlobalActions
> (Object: WorkflowUIMixin)
> File /home/zope/zopesig/lib/python/Products/CMFCore/CatalogTool.py, line 255, in searchResults
> (Object: Traversable)
> File /home/zope/zopesig/lib/python/Products/ZCatalog/ZCatalog.py, line 535, in searchResults
> (Object: Traversable)
> File /home/zope/zopesig/lib/python/Products/ZCatalog/Catalog.py, line 657, in searchResults
> File /home/zope/zopesig/lib/python/Products/ZCatalog/Catalog.py, line 542, in _indexedSearch
> File /home/zope/zopesig/lib/python/SearchIndex/UnTextIndex.py, line 516, in _apply_index
> File /home/zope/zopesig/lib/python/SearchIndex/UnTextIndex.py, line 579, in query
> File /home/zope/zopesig/lib/python/SearchIndex/UnTextIndex.py, line 651, in evaluate
> File /home/zope/zopesig/lib/python/SearchIndex/UnTextIndex.py, line 588, in get_operands
> TextIndex.QueryError: Malformed query
I can reproduce this against my sandbox. The problem lies in the
'CMFDefault/skins/content/metadata_edit.py', which uses 'return'
rather than redirecting. Here is a diff:
diff -u -r1.1 metadata_edit.py
--- CMFDefault/skins/content/metadata_edit.py 30 May 2001 22:00:25 -0000
1.1
+++ CMFDefault/skins/content/metadata_edit.py 14 Aug 2001 02:02:20 -0000
@@ -61,9 +61,6 @@
action_path = context.getTypeInfo().getActionById( action_id )
-action_method = context.restrictedTraverse( action_path )
-
-return action_method( context
- , context.REQUEST
- , portal_status_message='Metadata changed.'
- )
+context.REQUEST['RESPONSE'].redirect(
+ '%s/%s?portal_status_message=Metadata+changed.'
+ % ( context.absolute_url(), action_path ) )
which I am about to check in.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com