Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6847595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:45:50+00:00 2026-05-27T00:45:50+00:00

How do i debug my callback scripts? I have a deal_management function which does

  • 0

How do i debug my callback scripts?

I have a deal_management function which does grocery CRUD

and i have a

callback_after_insert( array( $this, ‘insert_coupon_codes’ ) );

since the insertion in the database is not working in my function insert_coupon_codes I have no way to know or view my SQL.

Is there any function by which i can debug my php scripts inside the callback function without any hacks?

I did print_r() and var_dump() but these do not seem to work inside the callback function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:45:51+00:00Added an answer on May 27, 2026 at 12:45 am

    First of all ensure that call_user_func works properly with your function. So for example you can try this:

    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();
        //Your code here
    }
    

    The problem in callbacks is that there is no error displaying when something goes wrong. So for example if you have

    call_user_func(array($this,'test2'));
    

    test2 function does not exist. But there is no error anywhere.

    If everything goes fine with this, you can simply debug your insert/update with a simply hack.

    In grocery CRUD the insert/update/delete is an ajax call, so to debug your project, you have to debug it with the firefox firebug.
    You can have your var_dump or print_r and see the ajax call response from your firebug. If you are not familiar with how to use firebug,
    I have a little hacking solution for the debug.

    Simply go to your add or edit form and disable all the javascripts
    (You can download Web Developer for firefox and then click Disable>Disable Javascript>All Javascript).
    Then if you refresh the form add or edit and push submit, there will be the ajax request in a view.
    So there you can see your var_dump or print_r.

    Still grocery CRUD doesn’t support debugging for callbacks so I think its a good solution for now. Beside this for debugging without hacking you can always easily have the log_message function of codeigniter. For more you can see at http://ellislab.com/codeigniter/user-guide/general/errors.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The debug screen says that django does not have write access to the db.
<script src=../../Scripts/MicrosoftAjax.debug.js type=text/javascript></script> <script type=text/javascript> function loginOK() { var item = document.getElementById('statusLabel'); item.innerHTML =
Debug HTTP is easy, you have all sort of tools to do it (like
I am using a jQuery Ajax control from this site http://abeautifulsite.net/2008/03/jquery-file-tree/ I have it
I got a Django project, with 1 application in it. If I have debug
I have the following (simplified) code: var Foo = (function () { var data
In viewDidLoad, I have subscribed to notifications to get external callback notifications. I dont
I have an ASP.Net hosted website which displays a list of results as a
I need to callback Javascript function in my code, but not firing. I am
I'm making a script which has one ajax call inside an each function. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.