calendarploneupgradeploneformgen

CalendarWidget broken on Plone 4.2.4 + PloneFormGen


I am migrating a site from 4.0.9 to 4.2.4. I have PloneFormGen form that has a date field and it breaks when rendering that field in a view. In this case, on the CalendarWidget associated with it.

The offending code has been added here https://github.com/plone/Products.CMFPlone/commit/5044d9159be33464ca8f79193af97d2822e833f9

The line minute_step minute_step | python: 5; is not evaluated properly somehow, and I get

  Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
   - __traceback_info__: date_components_support_view.result(inputvalue, 0, starting_year, ending_year, future_years, minute_step)
  Module PythonExpr, line 1, in <expression>
  Module plone.app.form.widgets.datecomponents, line 195, in result
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

whereas the NoneType value comes from minute_step.

Changing that line to minute_step python: minute_step or 5; makes it work again.

Am I the only one experimenting this?


Solution

  • You're not the only one. This is fixed on master of Products.Archetypes to provide a default value: https://github.com/plone/Products.Archetypes/blob/master/CHANGES.txt

    Ask for a release or run from a clone of the repo.