collective.data.examples自定义字段不会保存数据

时间:2013-05-13 08:24:36

标签: plone

这是this question的延续。 我用collective.examples.userdata 并成功将“位置”文本字段添加到我的用户注册表单中。我的问题是,当我进入我的/ @@个人信息页面时,填写该字段并点击“保存”,它只是再次显示该字段,它是空白的。我似乎无法将任何信息保存到此字段。我试过在前台模式下运行我的实例但是在尝试保存新信息时我看不到输出的任何内容。

我不知道这是否有帮助,但当我尝试使用以下TALES声明时:

tal:define="membership context/portal_membership;
            info python:membership.getMemberInfo(user.getId());"

然后:

tal:replace="info/position"

我得到以下追溯:

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PageTemplates.ZopePageTemplate, line 334, in _exec
  Module Products.PageTemplates.ZopePageTemplate, line 431, in pt_render
  Module Products.PageTemplates.PageTemplate, line 79, in pt_render
  Module zope.pagetemplate.pagetemplate, line 113, in pt_render
  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 620, in do_insertText_tal
  Module Products.PageTemplates.Expressions, line 225, in evaluateText
  Module zope.tales.tales, line 696, in evaluate
   - URL: /mysite/portal_skins/custom/home_page_view
   - Line 32, Column 11
   - Expression: <PathExpr standard:u'info/position'>
   - Names:
      {'container': <PloneSite at /mysite>,
       'context': <ATDocument at /mysite/front-page>,
       'default': <object object at 0x7f1c681eeb30>,
       'here': <ATDocument at /mysite/front-page>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x9540260>,
       'request': <HTTPRequest, URL=http://dan-apache:8080/mysite/front-page/home_page_view>,
       'root': <Application at >,
       'template': <ZopePageTemplate at /mysite/home_page_view used for /mysite/front-page>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'dan'>}
  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 77, in boboAwareZopeTraverse
  Module zope.traversing.adapters, line 136, in traversePathElement
   - __traceback_info__: ({'language': '', 'description': '', 'username': 'dan', 'has_email': False, 'location': '', 'fullname': '', 'home_page': ''}, 'position')
  Module zope.traversing.adapters, line 50, in traverse
   - __traceback_info__: ({'language': '', 'description': '', 'username': 'dan', 'has_email': False, 'location': '', 'fullname': '', 'home_page': ''}, 'position', [])
LocationError: ({'language': '', 'description': '', 'username': 'dan', 'has_email': False, 'location': '', 'fullname': '', 'home_page': ''}, 'position')

任何想法都将不胜感激!

1 个答案:

答案 0 :(得分:2)

好的,其他任何遇到此问题的人,我进入ZMI,进入portal_memberdata,然后在我的附加组件创建的位置字段中添加了一些文本。点击保存后,我可以看到/中的信息@@个人信息表,我现在可以按用户更新。