1

Plone セキュリティ パッチ 20161129を適用した後、ウムラウト (ä、ö、ß、または €) が含まれているため、PloneFormGen フォームが機能しなくなりました。Plone 4.3.9 の推奨バージョンである PloneFormGen 1.7.20 を使用します。スタックトレースは次のとおりです。

  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/var/plone/buildout-cache/eggs/Products.PloneFormGen-1.7.20-py2.7.egg/Products/PloneFormGen/skins/PloneFormGen/widget_fieldset_start.pt
   - Line 25, Column 10
   - Expression: <PythonExpr widget.Description(here)>
   - Names:
      {'container': <PloneSite at /mysite>,
       'context': <FormFolder at /mysite/mitglied-werden>,
       'desitelt': <object object at 0x7fe244f734b0>,
       'here': <FormFolder at /mysite/mitglied-werden>,
       'loop': {u'field': <Products.PageTemplates.Expressions.PathIterator object at 0x16fe5350>},
       'nothing': None,
       'options': {'args': (),
                   'state': <Products.CMFFormController.ControllerState.ControllerState object at 0x7fe22c676610>},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x1d61fc00>,
       'request': <HTTPRequest, URL=https://www.example.org/mitglied-werden/fg_base_view_p3>,
       'root': <Application at >,
       'template': <FSControllerPageTemplate at /mysite/fg_base_view_p3 used for /mysite/mitglied-werden>,
       'traverse_subpath': [],
       'user': <PloneUser 'siteb390'>}
  Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
   - __traceback_info__: widget.Description(here)
  Module PythonExpr, line 1, in <expression>
  Module Products.PloneFormGen.content.field_utils, line 27, in wDescription
  Module zope.i18n, line 107, in translate
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 20: ordinal not in range(128)

ウムラウトを削除すると、再び機能しますが、フォームが少し専門的ではないように見えます.

このエラーだけを求めて Web を 1 時間検索した後、どの拡張機能がこれを引き起こしているのか (PloneFormGen?) がこれを引き起こし、どのように修正するのか、特にわかりません :-/ どの方向をさらに調べればよいかさえわかりません...

4

1 に答える 1

3

1.7.20 以降、すべての PFG 記述フィールドが変換メカニズムを介してプッシュされます。(そもそも説明フィールドは言語に依存しないわけではないので、なぜユーザー提供のフィールドでそれを行うのか私に尋ねないでください。)これは、説明で使用できる文字に追加の制限を課します。 .

これがバグ修正であると主張しているわけではありませんが、私のクイック トライアルでは、buildout-cache/eggs/Products.PloneFormGen-1.7.20-py2.7.egg/Products/PloneFormGen/content/field_utils.py27 行目を

        if value:
        value = translate(value, context=instance.REQUEST)
        return cgi.escape(value)

    if value:
        value = translate(value.decode('utf-8'), context=instance.REQUEST)
        return cgi.escape(value)

問題を解消しました。

于 2016-12-05T16:25:58.433 に答える