Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: AJAX not working on Sugar v4.0.1!

  1. #1
    gosugar is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    108

    Default AJAX not working on Sugar v4.0.1!

    Everyone please help,

    I have Sugar v4.0.1 running on PHP 4.4.2 and Mysql 4.1. All the AJAX boxes has the running star on the left side when I type in letters but it does not return anything. Where would the code handle AJAX located? Thanks everyone.

  2. #2
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: AJAX not working on Sugar v4.0.1!

    Make sure that the 'site_url' value in your <sugarroot>/config.php is set correctly. That's probably why it's not working.

    -Sadek

  3. #3
    gosugar is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    108

    Default Re: AJAX not working on Sugar v4.0.1!

    The config file is right. I've done some upgrade from 3.5.1b to 4.0.0 to 4.0.1. I noticed before that after the upgrade, some old files did not get upgrade. I don't know where AJAX is hard code. Can anyone tell me please!

  4. #4
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: AJAX not working on Sugar v4.0.1!

    Instead of looking for the files that have the quick search code in them (the AJAX code you are referring to), since you said there may have been files that were skipped when upgrading, the correct and safer way to resolve this issue is to extract all the files in the upgrade patch and overwrite the ones in your production instance. You may want to back everything up first. Also, if you have any custom field layouts, I wouldn't overwrite the HTML files, and instead merge the old ones with the patch ones.

    This will ensure your files are in fact at the latest versions of all the files.

    Hope that helps.
    -Sadek

  5. #5
    gosugar is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    108

    Default Re: AJAX not working on Sugar v4.0.1!

    Thank you Sadek for helping me,

    There is a weird thing going on. I took a copy of the Sugar production(Apache2, Mysql4.1, PHP4.4.2) that having problem and install it on Windows (Apache2, Mysql4.1, PHP4.4.2) and it works fine. What do you suggest is happening. How can I debug this? The star keeps spinning when I am typing.

    Thanks again!

  6. #6
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: AJAX not working on Sugar v4.0.1!

    What about if you do a clean install of 4.0.1 onto the same machine that has the problematic instance? Do you still see the problem?

    -Sadek

  7. #7
    gosugar is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    108

    Default Re: AJAX not working on Sugar v4.0.1!

    I installed a fresh v4.0.1 on the same server and AJAX boxes work fine. Our production instance has many many modules and enhancements added, I just can't go in to reverse anything. I just want to know where the problem is to go and fix it. How would you go about to debug this problem? Thanks Sadek!

  8. #8
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: AJAX not working on Sugar v4.0.1!

    A couple things you can do to get your started:

    1)
    Go into your <sugarroot>/config.php and change slow_query_logging to true, and slow_query_msec_time to -1
    This will start logging all queries. You can click on the quick search functionality and check that the query being executed is valid by running it directly against the database.

    2)
    http://greasemonkey.mozdev.org/
    This is a firefox plugin that you'll need in order to install various scripts to allow you to track the AJAX calls.
    You can get these scripts at:
    http://userscripts.org/
    Search for XMLHttpRequest and you'll find some useful ones.

    If you still can't get anywhere, let us know and I'll see if I can give you some more input.

    -Sadek

  9. #9
    gosugar is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    108

    Default Re: AJAX not working on Sugar v4.0.1!

    Thank you Sadek,

    I did the first option and these are the loggings that I get

    The below code is the loggin from the working version (exact copy of Sugar on Windows). In Contact ListView, on the Assigned to: field on the MassUpdate section, I type in ad and the AJAX box return admin.

    SELECT distinct
    contacts.*,
    accounts.name as account_name,
    accounts.id as account_id,
    accounts.assigned_user_id account_id_owner,
    users.user_name as assigned_user_name
    FROM contacts LEFT JOIN users
    ON contacts.assigned_user_id=users.id
    LEFT JOIN accounts_contacts
    ON contacts.id=accounts_contacts.contact_id
    LEFT JOIN accounts
    ON accounts_contacts.account_id=accounts.id where contacts.deleted=0 AND (accounts.deleted is NULL or accounts.deleted=0) ORDER BY contacts.last_name, contacts.first_name asc LIMIT 0,300
    07/31/06 13:00:14,721 [2464] FATAL 127.0.0.1 - Slow Query (time:0.000664
    SELECT category, name, value FROM config
    07/31/06 13:00:27,297 [5632] FATAL 127.0.0.1 - Slow Query (time:0.00071
    SELECT users.* FROM users WHERE users.id = '1' LIMIT 0,1
    07/31/06 13:00:27,301 [5632] FATAL 127.0.0.1 - Slow Query (time:0.000493
    SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '1' and u1.deleted=0
    07/31/06 13:00:41,573 [4784] FATAL 127.0.0.1 - Slow Query (time:0.000694
    SELECT users.* FROM users WHERE users.id = '1' LIMIT 0,1
    07/31/06 13:00:41,579 [4784] FATAL 127.0.0.1 - Slow Query (time:0.000435
    SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '1' and u1.deleted=0
    07/31/06 13:00:41,610 [4784] FATAL 127.0.0.1 - Slow Query (time:0.000533
    SELECT id, first_name, last_name, user_name from users WHERE status='Active' AND is_group=0 AND user_name LIKE 'a%' order by user_name asc
    07/31/06 13:00:41,872 [5860] FATAL 127.0.0.1 - Slow Query (time:0.000613
    SELECT users.* FROM users WHERE users.id = '1' LIMIT 0,1
    07/31/06 13:00:41,880 [5860] FATAL 127.0.0.1 - Slow Query (time:0.000454
    SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '1' and u1.deleted=0
    07/31/06 13:00:41,907 [5860] FATAL 127.0.0.1 - Slow Query (time:0.000505
    SELECT id, first_name, last_name, user_name from users WHERE status='Active' AND is_group=0 AND user_name LIKE 'ad%' order by user_name asc
    07/31/06 13:03:29,057 [5536] FATAL 127.0.0.1 - Slow Query (time:0.000814
    SELECT users.* FROM users WHERE users.id = '1' LIMIT 0,1
    07/31/06 13:03:29,063 [5536] FATAL 127.0.0.1 - Slow Query (time:0.000515
    SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '1' and u1.deleted=0
    07/31/06 13:03:29,090 [5536] FATAL 127.0.0.1 - Slow Query (time:0.000567
    SELECT id, first_name, last_name, user_name from users WHERE status='Active' AND is_group=0 AND user_name LIKE 'ad%' order by user_name asc


    The below code is the loggin from the working version (exact copy of Sugar on Linux). In Contact ListView, on the Assigned to: field on the MassUpdate section, I type in ad and the star keeps spinning. Some querries are not being run as the above code so the search is not complete.

    SELECT distinct
    contacts.*,
    accounts.name as account_name,
    accounts.id as account_id,
    accounts.assigned_user_id account_id_owner,
    users.user_name as assigned_user_name
    FROM contacts LEFT JOIN users
    ON contacts.assigned_user_id=users.id
    LEFT JOIN accounts_contacts
    ON contacts.id=accounts_contacts.contact_id
    LEFT JOIN accounts
    ON accounts_contacts.account_id=accounts.id where contacts.deleted=0 AND (accounts.deleted is NULL or accounts.deleted=0) ORDER BY contacts.last_name, contacts.first_name asc
    Mon Jul 31 11:56:02 2006,054 [13075] FATAL 64.83.40.178 - Slow Query (time:0.000133
    SELECT category, name, value FROM config
    Mon Jul 31 11:56:04 2006,680 [13087] FATAL 64.83.40.178 - Slow Query (time:0.00061
    SELECT users.* FROM users WHERE users.id = '1' LIMIT 0,1
    Mon Jul 31 11:56:04 2006,683 [13087] FATAL 64.83.40.178 - Slow Query (time:0.000464
    SELECT u1.first_name, u1.last_name from users u1, users u2 where u1.id = u2.reports_to_id AND u2.id = '1' and u1.deleted=0


    --What do you think of this? Thank you.

  10. #10
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: AJAX not working on Sugar v4.0.1!

    Interesting. Clearly the non-working version (bottom one) is not even executing the query to pull up the information. I suggest installing greasemonkey and the XMLHttpRequest script. Once you do that, you can enable it, submit the AJAX request, and then see what is being sent/received. That may help in resolving the issue.

    As I said earlier, this issue usually does not occur unless the site_url is not correct.

    You might want to temporarily remove the .htaccess files and see if those are causing the problem. If not, put them back asap as to avoid leaving your system vulnerable to attacks.

    -Sadek

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •