Ticket #7133 (closed Bug: fixed)

Opened 4 years ago

Last modified 4 years ago

UnicodeError: CMF Action with non-ascii in description

Reported by: juh Owned by: hannosch
Priority: major Milestone: 3.1.5
Component: Internationalization Keywords:
Cc:

Description

When I add a CMF Action eg. in portal_tabs I can add a title and a description. But when I fill in a non-ascii letter I get this unicode error:

Site Error

An error was encountered while publishing this resource.

UnicodeDecodeError
Sorry, a site error occurred.

Traceback (innermost last):

    * Module ZPublisher.Publish, line 202, in publish_module_standard
    * Module ZPublisher.Publish, line 150, in publish
    * Module plone.app.linkintegrity.monkey, line 21, in zpublisher_exception_hook_wrapper
    * Module Zope2.App.startup, line 221, in zpublisher_exception_hook
    * Module ZPublisher.Publish, line 119, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 42, in call_object
    * Module Shared.DC.Scripts.Bindings, line 313, in __call__
    * Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
    * Module Products.CMFCore.FSPageTemplate, line 216, in _exec
    * Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
    * Module Products.PageTemplates.PageTemplate, line 89, in pt_render
    * Module zope.pagetemplate.pagetemplate, line 117, in pt_render
    * Module zope.tal.talinterpreter, line 271, in __call__
    * Module zope.tal.talinterpreter, line 346, in interpret
    * Module zope.tal.talinterpreter, line 891, in do_useMacro
    * Module zope.tal.talinterpreter, line 346, in interpret
    * Module zope.tal.talinterpreter, line 536, in do_optTag_tal
    * Module zope.tal.talinterpreter, line 521, in do_optTag
    * Module zope.tal.talinterpreter, line 516, in no_tag
    * Module zope.tal.talinterpreter, line 346, in interpret
    * Module zope.tal.talinterpreter, line 891, in do_useMacro
    * Module zope.tal.talinterpreter, line 346, in interpret
    * Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
    * Module zope.tales.tales, line 696, in evaluate
      URL: file:/home/juh/plone30/default/Products/CMFPlone/skins/plone_templates/global_defines.pt
      Line 8, Column 0
      Expression: <PathExpr standard:u'plone_view/globalize'>
      Names:

      {'container': <PloneSite at /www.generationenprojekt.de>,
       'context': <ATDocument at /www.generationenprojekt.de/impressum>,
       'default': <object object at 0x402c9528>,
       'here': <ATDocument at /www.generationenprojekt.de/impressum>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x4556480c>,
       'request': <HTTPRequest, URL=http://213.239.195.27:11080/www.generationenprojekt.de/impressum/document_view>,
       'root': <Application at >,
       'template': <FSPageTemplate at /www.generationenprojekt.de/document_view used for /www.generationenprojekt.de/impressum>,
       'traverse_subpath': [],
       'user': <SpecialUser 'Anonymous User'>}

    * Module zope.tales.expressions, line 217, in __call__
    * Module Products.PageTemplates.Expressions, line 161, in _eval
    * Module Products.PageTemplates.Expressions, line 123, in render
    * Module Products.CMFPlone.browser.ploneview, line 68, in globalize
    * Module Products.CMFPlone.browser.ploneview, line 117, in _initializeData
    * Module plone.memoize.view, line 49, in memogetter
    * Module plone.app.layout.globals.context, line 196, in actions
    * Module Products.CMFPlone.ActionsTool, line 114, in listFilteredActionsFor
    * Module Products.CMFPlone.ActionsTool, line 55, in listActionInfos
    * Module Products.CMFCore.ActionInformation, line 184, in __init__
    * Module Products.CMFCore.ActionInformation, line 151, in getInfoData

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128) (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128))
}}

Change History

comment:1 Changed 4 years ago by hannosch

  • Status changed from new to assigned
  • Owner changed from somebody to hannosch
  • Component changed from Unknown to Internationalization

This is a combination of a CMF and migration bug. The migration sets a default domain of 'plone' for all action objects which don't have one and CMF then tries to build a Message from that.

As the Message only accepts Unicode as input it fails on the utf-8 string. We probably should extend the actions migration to convert the title and description to Unicode here.

comment:2 Changed 4 years ago by hannosch

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [22083]) Fixed UnicodeError in CMF actions with non-ascii in title or description after migration from Plone pre-3.0. This closes #7133.

Note: See TracTickets for help on using tickets.