Actually I'm not sure if it is a opencalais bug, or an interaction with one of the multiples module I use.
The problem is that loaded_node is wrong, and drupal_render($loaded_node->content) does not return anything
My modification bellow is wrong, since it load a previously saved version of the node, but that the "$node" passed as parameter does not contain the body anymore ...
but at least I can get some keywords now ...
function calais_process_with_calais(&$node) {
// #412796: This was changing $node->body w/o the clone
$loaded_node = node_load($node->nid); // REMOVED node_build_content(drupal_clone($node));//
$body = $body = strip_tags($loaded_node->body); // REMOVED strip_tags(drupal_render($loaded_node->content));
$date = format_date($node->created, 'custom', 'r');
// Allow modification of the content sent to Calais
drupal_alter("calais_body", $body, $loaded_node);
if (!is_calais_api_key_set()) {
$node->calais->service = NULL;
return array();
}
$calais = new Calais();
$keywords = $calais->analyzeXML($node->title, $body, $date);
//drupal_set_message("keywo
".print_r($keywords,true)."$body
");
$node->calais->service = $calais;
return $keywords;
}
ref: using D6.19 with pressflow
Comments
Comment #1
elusivemind commentedThis is difficult to read. Going to mark this as unable to reproduce because..... well I can't reproduce it and with the code looking like this it is hard to read. If you get a fix and can make a patch so I can see the code as it would be applied then it would be better.