Summary of the date_deploy issues:
Currently CCK date fields can only be deployed if they are select lists. Other widget types (such as date_popup or date_text) fail due to the usage of drupal_execute() on the target server to rebuild nodes.
Ideally, there's a better interface than drupal_execute() to handle this sort of thing. Moving to node_save() may be "better" but would likely introduce a whole slew of other issues due to validation (or the lack thereof) problems.
A sub-optimal solution would be to make changes to Date module to allow for more robust input into drupal_execute(), however that is likely not a trivial task, and for the main purpose of drupal_execute() (form processing) a bit counter-intuitive.
This patch aims to temporarily bridge the problem until a better solution can be found, and allows for the following:
- Handles timezone issues.
- Allows for date_popup, date_select, and date_text datetime widget types to be deployed.
- Handles single date fields, as well as TO and FROM date fields of the above widget types.
This patch does not provide support for "date" or "datestamp" fields at the moment, and does not correct the initial issue of date munging within drupal_execute().
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | deploy.date_deploy_0.patch | 4.66 KB | brad.bulger |
| date_deploy.module.patch | 5.01 KB | mundanity |
Comments
Comment #1
dixon_The discussion of
drupal_execute()vsnode_save()is a long going discussion, not only for the Deploy module. Both approaches have pros and cons, really.The approach you are taking with this patch seems reasonable to me. I'll have to give it some real tests first, though.
Comment #2
dixon_Changing the title to be a little more clear
Comment #3
dixon_Id like to have better support for Date field before we roll a beta
Comment #4
dixon_Comment #5
katbailey commentedIt seems to me, and certainly in accordance with recent discussions with heyrocker, that date_deploy doesn't really work at the moment anyway, unless your requirements of it are extremely limited and conform to a very specific use case for date fields (select lists, no 'to' date, time zones don't matter).
This patch makes the module "work" in a much stronger sense of "work" ;-) So it would be great to get it in as is and as soon as possible, even if further improvements are eventually desired.
Comment #6
hamburgers commentedI was having major issues with deploying dates, they were appearing as blank once deployed. Various other errors popped up along the way. I discovered that most of my problems came from the version of PHP I was using. I had PHP 5.3 but after downgrading to 5.2.9 dates are now being deployed properly. The patch in this post also helped deploy date_popup dates.
Comment #7
ianwremmel commentedI can confirm the blank date values as reported by hamburgers on PHP 5.3 and a downgrade to 5.2 fixed the problem. Should a new issue be made regarding this?
Comment #8
gddYes please open a new issue about the PHP 5.3 issue
Comment #9
dixon_I was going to commit this patch. But the patch above fails with two hunks.
If someone doesn't beat me to it, I will re-roll this the upcoming weekend.
Comment #10
brad.bulger commentedthis is a reroll against the latest dev version, plus a typo fix: from
+ $rebuild[$key]['minute'] = str_pad($value['minute'], 2, '0', STR_PAD_LEFT);to
+ $rebuild[$key]['minute'] = str_pad($rebuild[$key]['minute'], 2, '0', STR_PAD_LEFT);Comment #11
dixon_I gave this some additional testing today, and it seems to work as intended. So, I also committed this. Yay! Thanks all for working on this.