I have an issue on a fresh, clean plone 5.0.7 installation.
I create a dexterity content type with a required date field, and have an issue. Is this a known bug, or caused by a misconfiguration? I'd happily report this bug somewhere - but I am not sure what module it applies to. Mockup?
To begin with the date widget is empty, and no validation error is marked. Fine.
When selecting a date for the first time, the field is marked with a validation error. (Required input is missing.)
Sometimes the date is not inserted. The date selector stays open.
Selecting the same date again (or another date) in the open date selector inserts the date but does not clear the error marking.
Other times the date is inserted and the selector closed, but the field still marked with a validation error.
Clicking the date selector again, choosing the same (or another) date, clears the error.
Part of my code is pasted here:
from plone.app.z3cform.widget import DateFieldWidget
from plone.autoform import directives as form
from plone.supermodel import model
from plone.namedfile.interfaces import IImageScaleTraversable
from zope import schema
class IAbstract(model.Schema, IImageScaleTraversable):
"""
"""
item_publication_date = schema.Date(
title=_(u"Udgivelsesdato"),
required=True,
)
form.widget('item_publication_date', DateFieldWidget)
I think the fix is in the js in mockup.
I already upgraded plone.app.z3cform and plone.z3cform to the latest - they seem to work fine in 5.0.x. (I see some changes in p.a.z3cform related to the later version of mockup)
If I want to try to upgrade mockup and see what happens - is using a newer version of mockup simply a matter of getting the egg of the later version, or do I need to build the js? I havent yet had time to investigate mockup and the grunt scripts etc. that much...
The result of the build - the js bundles - live in mockup? Would like to try to play around with it, to get updated on the structure etc.
Not in a hurry here - maybe we can even hit the first plone 5.1 release, I will see.
I found a similar problem in Plone 5.2.
I was trying to use the date filed inside a own dexterity content type.
But after saving there was an error in the format.
If i disable the time field to leave just the date there is a diffrent error from plone,
where it was trying to get a time out of a date.