最近、サイトをplone 4にアップグレードしましたが、日付が1970年より古い場合、カレンダーピッカーが機能しないことに気付きました。小さなデバッグの後、この行に問題があることに気付きました。
plone.app.form.widgets.datecomponents.py -> result method
1970年未満の日付の場合、date.timeTime
結果は負の値になり、現地時間の方法では正の値が期待されます。
local_zone = date.localZone(localtime(date.timeTime()))
ヘルプ、アイデア、提案は常に良いです
これがトレースバックです
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 Products.CMFFormController.ControllerPageTemplate, line 75, in __call__
Module Products.CMFFormController.BaseControllerPageTemplate, line 31, in _call
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 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 821, in do_loop_tal
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 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
Module zope.tales.tales, line 696, in evaluate
- URL: calendar_macros
- Line 12, Column 4
- Expression: <PythonExpr date_components_support_view.result(inputvalue, 0, starting_year, ending_year, future_years)>
- Names:
{'container': <ATFolder at /rcseng/account>,
'context': <ATFolder at /rcseng/account>,
'default': <object object at 0x01DE1830>,
'here': <ATFolder at /rcseng/account>,
'loop': {u'record': <Products.PageTemplates.Expressions.PathIterator object at 0x0E0BEAB0>},
'nothing': None,
'options': {'args': (),
'state': <Products.CMFFormController.ControllerState.ControllerState object at 0x0E287F30>},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x0E21E810>,
'request': <HTTPRequest, URL=http://dev.rcseng.ac.uk/account/my_details>,
'root': <Application at >,
'template': <ControllerPageTemplate at /rcseng/account/my_details>,
'traverse_subpath': [],
'user': <PloneUser '227225'>}
Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
- __traceback_info__: date_components_support_view.result(inputvalue, 0, starting_year, ending_year, future_years)
Module PythonExpr, line 1, in <expression>
Module plone.app.form.widgets.datecomponents, line 97, in result
ValueError: (22, 'Invalid argument')