Results 1 to 5 of 5

Thread: Be advised of a bug with Saluation field that can occur in SOAP calls

  1. #1
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Be advised of a bug with Saluation field that can occur in SOAP calls

    Hi all,

    Just wanted to post info about something that cost me my Sunday night:

    I used a SOAP client to connect to SugarCRM, to get Contact information. This client gave problems retrieving the list of Contacts. It gave an Null Reference (sort of a NullPointer) error (it's a .NET client)

    Now, this client is closed source so my options for debugging were limited. I luckily found some ways it works, and some way it wouldn't. So I started testing possible causes. I tested the program with only a single record in the database and with a few, etc.

    After a few hours I was positive that this was an data issue, not code. Because the database contents predicted the success or failure of the SOAP call. Now, it appears that a dash ("-") sign in the KEY component of a dropdown DOM causes Sugar UI to work perfectly, but really screws up SOAP actions.

    I had this code:

    PHP Code:
    $GLOBALS['app_list_strings']['salutation_dom']=array (
      
    '-blank-' => '',
      
    'Dr.' => 'Dr.',
      
    'Prof.' => 'Prof.',
      
    'MSC' => 'MSc',
      
    'BSc' => 'BSc',
      
    'LLB' => 'LLB',
      
    'LLM' => 'LLM',
      
    'MBA' => 'MBA',
      
    'BBA' => 'BBA',
      
    'RA'  => 'RA',
    ); 
    ..overriding the salation dom. The first line key "-blank-" caused all problems!!! Replacing '-blank-' with '' and setting all records to salutation = null fixed the problem.

    PHP Code:
    UPDATE <tableSET salutation NULL
    What have we learned?
    SugarCRM's SOAP server component cannot handle dashes in dropdown keys.

    What to do?
    Modify Studio to reject dashes. Modify developer documentation to warn about problems when using dashes.

    Now I already was pro-INT keys for dropdowns before all this. This is another reminder to myself to use just NUMBERS for dropdown keys...so I have myself to blame I suppose.
    Last edited by SugarDev.net; 2008-10-26 at 08:34 PM.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  2. #2
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Be advised of a bug with Saluation field that can occur in SOAP calls

    I created bug 25717 to track this issue.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  3. #3
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Be advised of a bug with Saluation field that can occur in SOAP calls

    Thnx clint. I have a possible fix:

    The maker of the program gave me a possible fix:

    The function function get_field_list(&$value, $translate=true){ Defined in soap\SoapHelperFunctions.phpI recommend you to encode the option name in line 68:

    $options_ret[] = get_name_value($key,$oneOption);

    Something like this should do the trick:

    $options_ret[] = get_name_value(htmlspecialchars($key),$oneOption);
    Also: please check out Sugar Bugs. I cannot add any Notes (it says "Note saved" but I don't see the note).
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  4. #4
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: Be advised of a bug with Saluation field that can occur in SOAP calls

    I've tested this and it seems to work!

    I have another request Clint: The Salutation field is a varchar of length 5. "-blank-" didn't fit in there and i wasn't aware of it, and this caused another way in which a key value is not known (because they were all stored as "-blan" in the database). I worked under the assumption that all dropdown fields are 255 long (as are all Studio created dropdown fields). Personally I will be using integers (1 - 99999) for keys in future versions of my modules, so I won't really care about this, but I wanted to inform you anyway.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  5. #5
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Be advised of a bug with Saluation field that can occur in SOAP calls

    Quote Originally Posted by SugarDev.net
    Also: please check out Sugar Bugs. I cannot add any Notes (it says "Note saved" but I don't see the note).
    Looking into it.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom field in (Activities) Calls subpanel listview
    By ChocolateLover in forum Developer Help
    Replies: 2
    Last Post: 2010-04-21, 10:42 AM
  2. SugarCRM + SOAP + ColdFusion + Bug Tracker
    By chrisborah in forum Help
    Replies: 15
    Last Post: 2010-04-19, 11:14 AM
  3. SOAP possible bug in get_related_notes
    By umquat in forum Developer Help
    Replies: 5
    Last Post: 2006-02-03, 01:23 AM
  4. New dropdown field in CALLs
    By ludvik in forum General Discussion
    Replies: 0
    Last Post: 2005-06-23, 09:17 AM

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
  •