First of all, make sure that the call_user_func function works correctly with your function. So, for example, you can try the following:
function just_a_test() { call_user_func(array($this,'insert_coupon_codes')); } function insert_coupon_codes($post_array = array(), $primary_key = null) { echo "Just a test"; die();
The problem with callbacks is that something doesn't happen when displaying errors. For example, if you have
call_user_func(array($this,'test2'));
The function test2 does not exist. But there is no mistake.
If all goes well with this, you can simply debug your insert / update with a simple hack.
In grocery CRUD, inserting / updating / deleting is an ajax call, so you must debug it using firefox firefox to debug your project. You can get your var_dump or print_r and see the response to the ajax call from your firebug. If you are not familiar with how to use firebug, I have a small hacking solution for debugging.
Just go to the add or edit form and disable all javascripts (you can download the web developer for firefox, and then click Disable> Disable JavaScript> All Javascript). Then, if you update the form, add or edit, and click submit, the ajax request will appear in the view. So you can see your var_dump or print_r.
Another CRUD product does not support debugging for callbacks, so I consider it a good solution at the moment. In addition, for debugging without hacking, you can always easily use the log_message function for codeigniter. You can see more details at http://ellislab.com/codeigniter/user-guide/general/errors.html