1
我想用一個獲批准的用戶對用戶進行批量更新,表使用VBO在Drupal更新的自定義用戶字段
field_user_status_value
-----------------------
entity_type, entity_id, field_user_status_value
的ENTITY_ID是不存在於表中的用戶ID,下面是自定義模塊我寫的更新表:
function bulkapprove_action_info() {
return array(
'bulkapprove_action_callback_name' => array(
'type' => 'user', // Can be file, term, user, etc.
'label' => t('Approve User'),
'configurable' => FALSE, // Doesn't need config form
'behavior' => array('view_property'), // Uses view access rights ,
'pass rows' => TRUE,
'triggers' => array('any'), // Works always
),
);
}
function bulkapprove_action_callback_name($entity, $context)
{
db_update('field_data_field_user_status')->fields(array('field_user_status_value' => 'Approved'))->condition('entity_id', $context->entity_id)->execute();
}
但它不是在這個表中插入值