function feedapi_create_node($param, $url) {
if (is_object($param)) {
$node = $param;
}
else {
$node = new stdClass();
$node->type = $param;
}
if (!feedapi_enabled_type($node->type)) {
return FALSE;
}
$feed = _feedapi_build_feed_object($node->type, $url);
if (!$feed->title && !$node->title) {
return FALSE;
}
This will always fail if the $param is a not an obj. Since the $node->title is never set.
Comments
Comment #1
aron novakThe following code works fine:
It will only fail (and it is a sane behaviour) when the feed does not contain a title itself.
Can you paste here the code line what you use?