Date fields
| Project: | Workflow Fields |
| Version: | 6.x-1.1 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I have a content type with a date field (Date 2.1); if I set the field as visible but not editable, when I save a node, i get the following errors:
warning: date_offset_get() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 494.
warning: date_format() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 497.
warning: date_format() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 498.
warning: date_offset_get() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 500.
warning: date_timezone_set() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 501.
warning: date_timezone_set() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 502.
warning: date_format() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 503.
warning: date_format() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 504.
warning: date_timezone_set() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 512.
warning: date_timezone_set() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 513.
warning: date_format() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 514.
warning: date_format() expects parameter 1 to be DateTime, null given in <...>date/date/date_elements.inc on line 517.
and th field gets empty.
With Date 2.2 I get:
warning: array_shift() [function.array-shift]: The argument should be an array
as soon as I edit the node.

#1
With Date 2.2, please edit the file date/date_elements.inc by moving the code
if (isset($element['#access']) && empty($element['#access'])) {return;
}
from the top of function
date_combo_process()to the top of functiondate_combo_validate(). Please let me know if it works for you. If it does, then please vote for the related issue in the Date module to encourage this fix: #408770: #access of date_combo fields prevents validation.#2
Hi kratib, the patch you suggested solves the error message, but when I submit the content the field gets emptied...
#3
Thanks. I will continue to investigate this.
#4
Hi Kratib, just letting you know the lastest date field issue that I've come across using your module. It's quite strange actually, I have a datetime field setup with the standard jquery datepicker widget. This field is within a field group. I've created a workflow and in the creation stage set visibility to all.
When trying to create the workgroup content type I've noticed that the field group with the datetime field just disappears. I then move the date field to another field group and that field group disappears. If I move it to the same level as the field groups then the field groups and all the other fields disappear?
No error messages it just disappears. After more research I noticed that the datefield shows only for user 1 while using your modules. I'm not using the field permissions modules or any other module that would effect field type the permissions.
I've tried latest releases and dev releases for your module / date module and workflow module without any success.
Let me know what you think.
PD