Upgraded to php5 and import no longer works
dgraver - November 21, 2008 - 06:42
| Project: | CCK Validation |
| Version: | 5.x-0.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I run a script that pulls down Las Vegas odds from a script. It had been running fine for over a year, then I needed to upgrade to php5 for another site on the same server, and now the script has issues. I believe it has something to do with how php5 handles array_merge now, but not sure...here is how I import the node.
//first create the node properly...
node_validate($node);
$error = form_get_errors();
if (!$error ) {
$node = node_submit($node);
node_save($node);
} else {
print_r($error);
}For whatever reason, it messes up my node...example
//before node_validate
[field_poll_spread] => Array
(
[active] => 1
[runtime] => 1227576900
[question] => Who to Bet?
[0] => Array
(
[choice] => Green Bay Packers (Off)
[votes] => 0
)
[1] => Array
(
[choice] => New Orleans Saints (Off)
[votes] => 0
)
)...After node_validate
[field_poll_spread] => Array
(
[0] => Array
(
[question] => Who to Bet?
[runtime] => 1227576900
[active] => 1
[choice] => Green Bay Packers (Off)
[votes] => 0
)
[1] => Array
(
[question] => Who to Bet?
[runtime] => 1227576900
[active] => 1
[choice] => New Orleans Saints (Off)
[votes] => 0
)
)... After node_submit
[field_poll_spread] => Array
(
[0] => Array
(
[question] =>
[runtime] =>
[active] =>
[choice] => Green Bay Packers (Off)
[votes] => 0
)
[1] => Array
(
[question] =>
[runtime] =>
[active] =>
[choice] => New Orleans Saints (Off)
[votes] => 0
)
)I believe I've tracked it down to the content.module and specifically the function _content_widget_invoke('process form values', $node);
Any advice would be appreciated. Thank you.

#1
The issue had to do with the fact I was passing an object to node_validate instead of an array. Not sure why this worked fine with php4 and not php5, but all is good now.