Return error or debug messages when using before insert
- Single Page
Posted 24 October 2012 - 00:51 AM
However, I have some complicated coding to do for this piece and I'm having trouble sending back error or debug messages -- getting JSON syntax errors in firebug.
Any advice for sending debug messages back to the screen?
Posted 24 October 2012 - 22:34 PM
I have my video controller that has a call to: $this->grocery_crud->callback_before_insert(array($this->video_model,'save'));
In the video model, I have calls to outside API's I have to make using curl.
Since the save function is using ajax (and since this involves a file upload, so I can't turn off javascript) -- I try to echo the messages back; however, when I do that, I get a json syntax error.
I see I can do this: return json_encode(array('success' => true , 'success_message' => "test"));
However, even this is very sensitive to syntax.
Any suggestions are appreciated.
Thanks,
Posted 26 October 2012 - 16:39 PM
I have the same issue, I'm going to try to set a set_rules in the id field and check in the function if I can save or update the record.
Hope it helps you
Luis
Posted 26 October 2012 - 17:03 PM
Not the best of solutions -- but it got it done.