When trying to deploy an 'event' node which contains two date cck fields I get the following error in the logs
First parameter must either be an object or the name of an existing class in /var/www/html/drupal-6/sites/all/modules/deploy/modules/date_deploy/date_deploy.module on line 45.
When trying to do the operation I also get this failed error message from the Deployment module
There are errors in Event Start:The dates are invalid.
I have deployed a basic 'page' successfully but the date cck stuff fails.
Any help would be great!
Thanks,
md2
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | date_deploy.patch | 1.61 KB | Anonymous (not verified) |
| #2 | deploy_date.diff | 2 KB | natmchugh |
Comments
Comment #1
Anonymous (not verified) commentedIt looks like the node passed into function date_node_deploy(&$node) has an nid of NULL, so node_load() fails, and then property_exists() fails.
Comment #2
natmchugh commentedOk I had this issue and managed to fix it with the attached patch. I found 2 separate problems.
1) Node deploy was getting called with the remote node id therefore why it was NULL for heckacopter213. I have added an extra prameter to the invocation of hook_node_deploy to add in the local nid allowing adding the correct date valuess.
2) date_deploy_get_date_fields was not finding my date fields as they were of type datetime not date. I have added datetime to the list of field types considered dates.
Other than this the module works really well
Comment #3
Anonymous (not verified) commentedFirst of all, thanks for the patch!
Unfortunately, it's not working quite right for me, but I'm probably an edge case. After applying the patch, the error went away, but I get empty date values on my destination server. I am using a date with start and end dates. I can see it's being passed over the wire like so:
But nothing is saved on the destination server for field_check_point_date. Any clues?
Thanks!
Comment #4
Anonymous (not verified) commentedI've implemented a fix that pushes all date values across the wire (value and value2), but it's still not saving for some reason. Hopefully I get it figured out and I'll post my patch.
Comment #5
gddSo there are two issues here. One is the problem shown in #2, which needs to be fixed although I'll probably do it slightly differently.
The second is that Date fields are extremely hard to deal with through drupal_execute() (which is what Services uses.) This is related to the fact that values coming through FAPI are reliant on widget settings, and Date has a wide array of widget and value combinations. Currently Date is only tested with Date field types using select widgets. To see how harsh this is refer to this thread form the Node Import module where they are fighting similar problems
#374346: Can't import date values into Date module fields
I've opened a new issue related to Date fields in Deploy for the record (#655964: Some combinations of Date field widgets don't work) and if anyone wants to start chasing this problem that is fine, but I am not going to be spending much time trying to sort all that out for the time being. It's just too gnarly and I've got other problems to solve.
Comment #6
gddHere is the patch I ended up committing. In order to manage the node->nid problem, I simply moved the code which replaces client nid with server nid to after the hook_deploy() call. This has the advantage of not changing any existing function signatures and just makes sense regardless.
Thanks!
Comment #7
Anonymous (not verified) commentedHeyrocker, thanks. I changed my widget to select list on the destination server and now it works fine.
I'm attaching a patch to date_deploy that picks up end-dates as well as start dates.
Comment #8
Anonymous (not verified) commentedI'm sure this is a bug in services, but if you leave minute set to 00, you get an error that "Illegal choice 0 in field_check_point_date element." If you set it to '00' in a debugger, it goes through fine.
I fixed it in date_deploy with the following:
Comment #10
sagar ramgade commentedHi,
I tried the patch above and suggestion comment #8, i am trying to deploy it with datetime and it is not working.
Obviously it is stated in the documentation that it won't work. Can anyone help in this.
Regards
Sagar
Comment #11
snehi commentedAny progress on this issue