1

カスタムの器用さコンテンツ タイプのインポーターを作成しました。タイプは正常にインポートされますが、新しくインポートされたコンテンツを表示しようとすると「LocationError」が発生し、次のトレースバックが表示されます。

Traceback (innermost last):
  Module ZPublisher.Publish, line 60, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module grokcore.view.components, line 140, in __call__
  Module grokcore.view.components, line 144, in _render_template
  Module five.grok.components, line 130, in render
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 946, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /home/action/workspace/zeocluster/src/collective.nonprofitprogrammes/collective/nonprofitprogrammes/programme_templates/programmeview.pt
   - Line 20, Column 8
   - Expression: <PathExpr standard:u'context/background/output'>
   - Names:
      {'args': (),
       'container': <Programme at /Plone2/my-content/dry-forest-conservation-programme>,
       'context': <Programme at /Plone2/my-content/dry-forest-conservation-programme>,
       'default': <object object at 0x7f60dda304e0>,
       'here': <Programme at /Plone2/my-content/dry-forest-conservation-programme>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f60cc0673c0>,
       'request': <HTTPRequest, URL=http://mybox-23772.use1.actionbox.io:8080/Plone2/my-content/dry-forest-conservation-programme/programmeview>,
       'root': <Application at >,
       'static': <Products.Five.metaclass.DirectoryResource12 object at 0x7f60cc073ed0>,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x8ee7550>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <collective.nonprofitprogrammes.programme.ProgrammeView object at 0x7f60cc073bd0>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f60cc073c10>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 97, in trustedBoboAwareZopeTraverse
  Module zope.traversing.adapters, line 136, in traversePathElement
   - __traceback_info__: (u'Jam...ation.\n', 'output', [])
LocationError: (u'Jam...ation.\n', 'output')

興味深いことに、コンテンツ タイプの URL に続いて /edit が機能し、変更を保存した後にビューが機能します。

4

1 に答える 1

3

LocationError メッセージの「出力」部分は、RichText フィールドのレンダリングに問題があることを示しています。RichText フィールドを RichTextValue 以外のもので初期化した可能性はありますか?

RichText フィールドに文字列を割り当てることはできません。RichTextValue が必要です。

from plone.app.textfield.value import RichTextValue
context.body = RichTextValue(u"Your text here, in HTML")

詳細については、RichTextValue に関する Dexterity Developer's Manual セクションを参照してください。入力と出力の MIME タイプとテキストを設定できます。

于 2013-08-19T21:37:54.057 に答える