rooby's answer is probably the easiest/quickest method but just to offer a code solution that can be used with VBO...
You can define your own action to save the user like this:
function MYMODULE_rules_action_info() {
return array(
'MYMODULE_update_user_account' => array(
'label' => t('Save a user account'),
'parameter' => array(
'account' => array(
'type' => 'user',
'label' => t('User'),
),
),
'group' => t('MODULENAME'),
),
);
}
function MYMODULE_update_user_account($account) {
user_save($account);
}
Once you've clerared the caches you should see your new action appear under VBO/rules and anywhere else actions are used.
Edit: It seems this might re-inventing the wheel somewhat if VBO will already let you do it natively, but it's a nice simple example of a rules action so I'll leave it here in case anyone needs it. Plus it removes the need for eval()
to be used which is never a bad thing.
node_save()
withuser_save()
user_save($entity)
; this causes the user to be saved (I confirmed by adding a rule that shows a message on the site). However, no value is assigned to the new field, even if I run the save action multiple times. If I do it manually, though, from the People page, the default value is set.$items = field_get_items('user', $entity, 'field_name'); if (empty($items)) { $entity->field_name[LANGUAGE_NONE][0]['value'] = 1; } user_save($entity);
That should do the trick