New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various issues with plone.app.event 1.2 #147
Comments
hmm... looks like you haven't set the timezone of the event. look for https://github.com/plone/plone.app.event/blob/master/plone/app/event/dx/behaviors.py#L557 if you just want to upgrade, you can use the provided upgrade steps. hope that helps... please give some feedback, if this issue can be closed |
The issue is unrelated to timezones and upgrade. The Plone is is created from scratch with content generated through invokeFactory(). Also the start and end date use timezones
When I place context/start and context/end inside event_view.pt (having removed all other 2014-03-20 08:30:00+01:00 So there is obviously something bad inside the adapter magic. |
it is related to plone.app.event's timezone handling, as the traceback shows:
or simply:
i agree, it's not obvious to not set the start/end datetimes directly on the context or via invokeFactory. but that's the way, plone.app.event works at the moment. don't forget to set the portal's timezone to the main timezone your events are created in. otherwise UTC will be used. |
Please don't take it personally but this is broken-by-design and completely absurd. Do I have to check as a developer for every single attribute of a content-type it this field is introduced through a behavior or defined directly as part of the content-type schema? |
But anyway, the proposed solution does not work
The error remains the same. |
i don't take it personally. this is the way dexterity behaviors work. you have to adapt them to be sure that some setter/getter code is executed and thats what we need in this case. if you find another way to solve the timezone setting issue you're welcome to contribute and i would be happy to integrate that. i also don't like that part of plone.app.event too much. |
if you could give a bit more context, that would be helpful. what exactly is v or new_obj? |
'new_obj' is clearly the plone.app.event instance created using invokeFactory('Event') and v is the given datetime instance with CET timezone. |
The solution is set the 'timezone' explicitely on the obj new_obj = invokeFactory('Event',..) Why is there no default for 'timezone'? |
there is, but apparently that doesn't apply when using invokeFactory, where no z3c.form is involved: should be fixed. |
You can probably fix this by setting up the default using a defaultFactory directly on the field, rather than a ComputedWidgetAttribute. Dexterity's getattr knows how to look up field defaults, but it doesn't know anything about widgets. |
these issues should now be solved with plone.app.event 2.0. relevant changes from the changelog:
a how-to-use-it, which is hopefully quite complete, can be found here: |
i know, the "store timezone information directly on start / end properties" is discussed quite controversial. at wine/beer sprint @jensens , @regebro , @garbas and i were discussing this deeply and could not come up with any reason, why not to store the timezone information directly on these properties. with proper tzinfo objects, we can calculate from one timezone to another without any effort. we can also compare two datetimes with different timezones directly without having to convert them into the same base timezone. |
It also makes import/export to iCalendar simpler. |
Was this resolved in 1.1.x branch? I'm getting this issue after using p.a.contenttypes migrator with plone.app.event 1.1.4 |
We are using plone.app.event 1.2 with Dexterity and Plone 4.3.2 in a migration project.
start and end dates are generated during from DateTime instances using
start = datetime.fromtimestamp(start_date_old.timeTime()
....
The @@edit view of the related event instances works.
Trying to save an event fails with this:
2014-03-07 09:03:54 ERROR Zope.SiteErrorLog 1394179434.560.952354709109 http://dev1.veit-schiele.de:5080/eteaching/news/tagungen/ilias_2008/@@edit
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module plone.z3cform.layout, line 66, in call
Module plone.z3cform.layout, line 50, in update
Module plone.dexterity.browser.edit, line 54, in update
Module plone.z3cform.fieldsets.extensible, line 59, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 141, in update
Module plone.app.z3cform.csrf, line 21, in execute
Module z3c.form.action, line 98, in execute
Module z3c.form.button, line 315, in call
Module z3c.form.button, line 170, in call
Module plone.dexterity.browser.edit, line 25, in handleApply
Module z3c.form.group, line 97, in extractData
Module z3c.form.group, line 64, in extractData
Module z3c.form.form, line 146, in extractData
Module z3c.form.field, line 324, in extract
Module z3c.form.field, line 216, in validate
Module z3c.form.validator, line 201, in validate
Module z3c.form.validator, line 206, in validateObject
Module zope.interface.interface, line 590, in validateInvariants
Module plone.app.event.dx.behaviors, line 141, in validate_start_end
Module z3c.form.validator, line 175, in getattr
Module z3c.form.datamanager, line 71, in get
Module plone.app.event.dx.behaviors, line 342, in start
Module plone.app.event.dx.behaviors, line 399, in _prepare_dt_get
AttributeError: timezone
Calling the default view of an event fails with this:
2014-03-07 09:09:12 ERROR Zope.SiteErrorLog 1394179752.30.182035064437 http://dev1.veit-schiele.de:5080/eteaching/news/tagungen/ilias_2008/event_view
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.Five.browser.metaconfigure, line 479, in call
Module Products.Five.browser.pagetemplatefile, line 125, in call
Module Products.Five.browser.pagetemplatefile, line 59, in call
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 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
{'args': (),
'container': <Event at /eteaching/news/tagungen/ilias_2008>,
'context': <Event at /eteaching/news/tagungen/ilias_2008>,
'default': <object object at 0x7ff3f25f3b80>,
'here': <Event at /eteaching/news/tagungen/ilias_2008>,
'loop': {},
'nothing': None,
'options': {},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7ff3d6cf6cb0>,
'request': <HTTPRequest, URL=http://dev1.veit-schiele.de:5080/eteaching/news/tagungen/ilias_2008/event_view>,
'root': ,
'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7ff3d64ebdd0>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <Products.Five.metaclass.SimpleViewClass from /home/ajung/.buildout/eggs/plone.app.event-1.2-py2.7.egg/plone/app/event/browser/event_view.pt object at 0x7ff3d6b46090>,
'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7ff3d6b4fc90>}
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
Module zope.traversing.adapters, line 50, in traverse
LocationError: (None, 'isoformat')
The instance dict of an event looks like this
The text was updated successfully, but these errors were encountered: