Hello,
I'm trying to customize the behaviour of the Event type. I need to make some fields language independent.
I added this to the setuphandlers.py
from zope.interface import alsoProvides
from plone.app.multilingual.dx.interfaces import ILanguageIndependentField
from plone.app.event.dx.behaviors import IEventBasic
from plone.app.event.dx.behaviors import IEventContact
from plone.app.event.dx.behaviors import IEventAttendees
from plone.app.event.dx.behaviors import IEventRecurrence
from plone.app.contenttypes.behaviors.leadimage import ILeadImage
alsoProvides(IEventBasic['start'], ILanguageIndependentField)
alsoProvides(IEventBasic['whole_day'], ILanguageIndependentField)
alsoProvides(IEventBasic['open_end'], ILanguageIndependentField)
alsoProvides(IEventContact['contact_name'], ILanguageIndependentField)
alsoProvides(IEventContact['contact_email'], ILanguageIndependentField)
alsoProvides(IEventContact['contact_phone'], ILanguageIndependentField)
alsoProvides(IEventAttendees['attendees'], ILanguageIndependentField)
alsoProvides(IEventRecurrence['recurrence'], ILanguageIndependentField)
alsoProvides(ILeadImage['image'], ILanguageIndependentField)
On a text field like IEventContact['contact_name'] it works just fine however on IEventBasic['start'] it doesn't. The difference is that this field is defined as a widget in the behavior.
@adapter(getSpecification(IEventBasic['start']), IPloneFormLayer)
@implementer(IFieldWidget)
def StartDateFieldWidget(field, request):
widget = FieldWidget(field, DatetimeWidget(request))
widget.default_timezone = default_timezone
return widget
Anyone knows how to fix it?
Thanks