That's why I created the type "invisible" field. So for example if you have:
$crud->fields('field1','field2','field3');
$crud->callback_before_insert(array($this,'test_callback'));
and :
function test_callback($post_array){
$post_array['field4'] = 'test';
return $post_array;
}
This will NOT works unless you add the invisible field so you have to do it like this:
$crud->fields('field1','field2','field3','field4');
$crud->change_field_type('field4','invisible');
$crud->callback_before_insert(array($this,'test_callback'));
So this WILL WORK as you expected and without showing the field "field4" in the form.
The "invisible" field is made for this exact reason. I know that it is undocumented that's why I add it here.