I am using a module that automatically generates a node and saves it to the database, using node_save (the module is simplenews_digest)
The problem is that this way the format is not handled.
this could be fixed using something like:
function better_formats_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'presave':
if($node->format == FILTER_FORMAT_DEFAULT)
$node->format = better_formats_get_default_format('node', $node->type);
break;
}
}
Comments
Comment #1
dragonwize commentedAny module going directly through the node api should allow you to choose the format. The same goes when manually using the node api, you should always set your format.
If BF overwrote those formats there would never be a way for you to change the format to something other than the BF default. This also would have a devastating effect on the normal form process as it would override the format that you chose to use on your node during the node api saving operation which comes after the form display.