Within an instance of hook_submit (for a custom form), I'm trying to iterate over a list of nodes, updating each of them. The general outline is
$x = node_load_multiple($nids);
$data = array(--some data--);
foreach ($data as $row) {
$node = $x[$row['nid']];
$node->field_some_field['und'][0]['value'] = $row['some_field'];
node_save($node);
}
drupal_set_message('Nodes updated');
The problem I'm having is that rather than looping through the whole data array and then posting my confirmation message on the form page, Drupal updates the first node, exits the loop, and redirects to the user's home page with the message 'contenttype TITLE updated.'
Possibly relevant: I could have sworn this code block worked when the site was 7.2, but after updating to 7.23 I'm seeing this.
hook_node_insert()
orhook_node_update()
?