Closed (works as designed)
Project:
Resource Conflict
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Sep 2012 at 15:44 UTC
Updated:
6 Sep 2012 at 18:31 UTC
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
Comment #1
liberatrSmall update:
if (($field['required'] == 1) && isset($fieldinfo['settings']['todate'])) {Otherwise you will get notice errors for non-date fields.
Comment #2
ohthehugemanatee commentedThanks 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.
Comment #2.0
ohthehugemanatee commentedadded a supporting example