Hiya...

This is just a minor bug, but it displays an error which might be confusing for users filling out forms with dates using the select widget. On my site the 'From Date' is set as required, and the 'To Date' as optional. I've only tested this with the following granularity: Day/Month/Year Hour:Mins

If any of the day/month/year fields don't have, the form shows the following errors:

  • field is required.
  • field is required.
  • field is required.
  • field is required.
  • field is required.
  • Field Date From date has errors. The year must be a number between 1 and 4000. The month must be a number between 1 and 12. The day must be a number between 1 and 31.

It looks like the errors for all the fields are being added by date_select_validate() in date_api_elements.inc but because each field doesn't explicity have a title the field name is blank when displayed to the user.

If day/month/year is set, but hours:mins are left blank, the following error is shown:

  • field is required.
  • field is required.

Hope this helps, sorry I haven't had the chance to dig around for more info.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deviantintegral’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Component: Date CCK Field » Date API

I'm running into this as well. The issue appears to actually be with the underlying date form element.

deviantintegral’s picture

Status: Active » Needs review
FileSize
879 bytes

It looks like each sub-element is having #required set on it, which is throwing the extra errors. If the property is removed, validation still fails the element as the value isn't within the specified range. I've tested with date_select with dropdowns and textfields, but not anything higher up like the CCK date field.

Bao Truong’s picture

Version: 6.x-2.x-dev » 6.x-2.9
FileSize
744 bytes

Here is a git version for the 6.x-2.9 version of the date module

Status: Needs review » Needs work

The last submitted patch, 466134.3.field-errors.patch, failed testing.

DamienMcKenna’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Unfortunately the D6 version of this module is no longer supported, but we appreciate the time you put into this. If this problem is relevant for D7 too, please reopen the issue. Thanks.