I have written a custom field formatter for my date fields, but this module checks that the field is using a formatter from the date module as a part of the required field check.

As a workaround, I have changed the following line (204):

if (isset($field['display']['default']['module'])&&($field['display']['default']['module'] == 'date')&&($field['required'] == 1)) {

to more simply:

if ($field['required'] == 1) {

Since we are checking that 'todate' is required later, which should only exist on a date field.

This pattern is used in line 281:

if ($instance['required'] != 1 || $field['settings']['todate'] != 'required' ) {

Comments

liberatr’s picture

Small update:

if (($field['required'] == 1) && isset($fieldinfo['settings']['todate'])) {

Otherwise you will get notice errors for non-date fields.

ohthehugemanatee’s picture

Status: Active » Closed (works as designed)

Thanks for the code... I'm sure it will be helpful to others. I don't think I can roll this into the main module, though... 99% of use cases will be date module's date field. I guess we could test for something a bit deeper, like ensure that the field is storing data in a date format? If you can think of a way to make sure it's a date field without requiring specifically the date module, I'm all ears...

setting the issue as works as designed. Feel free to change it back to active if you can offer a good way to make sure it's a date field without requiring date module.

ohthehugemanatee’s picture

Issue summary: View changes

added a supporting example