First, Great work on the module! I am trying to build services with your API and, unless I'm wrong, bracket_api_set_competitors is missing "node_save($node);" in it as it never gets updated once called.

Here's my code

$competitors=array(
'Aaron',
'Richard',
'Jeff',
'Dan',
'Molly',
'Max',
'Jim',
'Sax');

$node = node_load(array('nid'=>14));
bracket_api_set_competitors($node, $competitors);

//Since it doesn't contain ndoe_save(..), I then have to run this: 
node_save($node);

Shouldn't this function contain node_save?

Comments

jimbullington’s picture

This is by design - none of the bracket manipulating functions actually update the bracket node. This was done so that more than one call could be made to the API without saving the node multiple times. The workflow should be:

$node = bracket_api_load_bracket($nid);  [or node_load as you have]
.
.
.
bracket_api_manipulating_function_1($node);
bracket_api_manipulating_function_2($node);
.
.
.
bracket_api_update_bracket($node); [or node_save as you have]

Hope this helps.

anAgent’s picture

Status: Active » Closed (works as designed)

Thanks, that does make sense. I'm closing the non-issue.