Skip to content
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

IEventBasic.start/end defaults are not written into the Object #252

Open
bearpreis opened this issue Oct 17, 2016 · 3 comments
Open

IEventBasic.start/end defaults are not written into the Object #252

bearpreis opened this issue Oct 17, 2016 · 3 comments

Comments

@bearpreis
Copy link

Hi, Plone Version 5.0.5.

When creating a new Event and just entering title, contact name and contact email, but ignoring the start and end times it will create an object in the zodb without any start or end attributes.
If you then lookup the events using the catalog you will find the start and end dates in the brain object but not in the zodb object itself.

This leads to unforseen circumstances, because every time you view the object it will tell you that it starts now (with zero minutes) and ends in an hour... it is wandering all the time.

What i expected was that it saves the defaults i saw in the form not only into the brain but also in the object itself.

Here is the example event we lookup using the get_event method with ret_mode=2:

result = get_events(self.context, start=start, ret_mode=2, expand=True, path='/'.join(self.context.getPhysicalPath()))
foo = [x for x in result if x.id == 'eventtest'][0]

ipdb> pp foo.__dict__
{'_Access_contents_information_Permission': ('Contributor',
                                             'Editor',
                                             'Manager',
                                             'Owner',
                                             'Site Administrator'),
 '_Change_portal_events_Permission': ('Editor',
                                      'Manager',
                                      'Owner',
                                      'Site Administrator'),
 '_Modify_portal_content_Permission': ('Editor',
                                       'Manager',
                                       'Owner',
                                       'Site Administrator'),
 '_View_Permission': ('Contributor',
                      'Editor',
                      'Manager',
                      'Owner',
                      'Site Administrator'),
 '__ac_local_roles__': {'myuser': ['Owner']},
 '__annotations__': <BTrees.OOBTree.OOBTree object at 0x7f9d3393a950>,
 '__provides__': <zope.interface.Provides object at 0x7f9d33bf08d0>,
 '_owner': (['myplone', 'acl_users'], 'myuser'),
 '_plone.uuid': '348f4be027ea4388b8ac4e711865cc4f',
 '_v__providedBy__': (1476715060.582746,
                      1469702558.3739538,
                      0,
                      8769572171917,
                      <implementedBy ?>),
 'cmf_uid': <Products.CMFUid.UniqueIdAnnotationTool.UniqueIdAnnotation object at 0x7f9d338ce668>,
 'contact_email': u'[email protected]',
 'contact_name': u'test',
 'creation_date': DateTime('2016/10/17 16:37:39.956548 GMT+2'),
 'creators': ('myuser',),
 'id': 'eventtest',
 'language': u'de-at',
 'location_id': 0,
 'modification_date': DateTime('2016/10/17 16:37:40.317872 GMT+2'),
 'portal_type': 'Event',
 'relatedItems': [],
 'rights': None,
 'text': None,
 'title': u'termintest',
 'version_id': 0,
 'workflow_history': {'intranet_workflow': ({'action': None, 'review_state': 'internal', 'comments': '', 'actor': 'myuser', 'time': DateTime('2016/10/17 16:37:40.013034 GMT+2')},)}}
@ericof
Copy link
Member

ericof commented Oct 30, 2017

Also facing this same issue.
When accessing the start and end attributes of the object, it will return the current date, not the one indexed by the catalog

@davisagli
Copy link
Member

Sounds related to the issue that was fixed in plone/plone.dexterity#67 (which is released in plone.dexterity 2.5.1 and Plone 5.1rc1)

@ericof
Copy link
Member

ericof commented Oct 30, 2017

Confirmed, pinning plone.dexterity to 2.5.1 (on a Plone 5.0.x buildout) solves the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants