Results 1 to 8 of 8

Thread: Popup windows search returning empty

  1. #1
    leowolff is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    126

    Default Popup windows search returning empty

    Sugar 5.2

    Hello, I am using a few custom modules, one of them called Offering has a button that call a popup on Services module, that popup should bring a list of all the services register (200+), but it comes empty (not blank). The popup windows (popupdefs.php) comes with the search fields on the top (searchdefs.php), and the listview on the botton, but empty.

    popupdefs.php :

    PHP Code:
    $module_name 'oqc_Product';
    $_module_name 'oqc_product';
    $_object_name 'oqc_product';
    $popupMeta = array('moduleMain' => $module_name,
                            
    'varName' => $module_name,
                            
    'orderBy' => $_module_name '.name',
                            
    'whereClauses' => 
                                array(
    'name' => $_module_name'.name'
                                        
    $_object_name '_number' => $_module_name'.'$_object_name.'_number'),
                                
    'searchInputs'=> array($_module_name '_number''name''priority','status'),
                                
    'listview' => 'modules/' $module_name '/metadata/listviewdefs.php',
                                
    'search'   => 'modules/' $module_name '/metadata/searchdefs.php',
                                
                            );
    ?> 

    Any tip where should I start looking to find the bug?


    Regards

  2. #2
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,130

    Default Re: Popup windows search returning empty

    Set the log level to debug and check the query used for popup in sugarcrm.log file

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Popup windows search returning empty

    Hi Leo

    Edit the file include/ListView/ListViewData.php and add this line

    PHP Code:
    echo "<LI>$main_query</LI>"
    Just after the line

    PHP Code:
    $main_query $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by']; 
    Try to access the popup again.
    A sql query will be displayed.
    Copy this and execute on phpMyAdmin, it should return an error.
    Also let us know it.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  4. #4
    leowolff is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    126

    Default Re: Popup windows search returning empty

    Thanks a lot Andre, you are taking me by hand into the world of programming... The SQL generated was:

    PHP Code:
    SELECT oqc_product.id ,oqc_product_cstm.numteclado_c,oqc_product_cstm.fonte_c,oqc_product_cstm.entrega_c,oqc_product_cstm.vga_c,oqc_product_cstm.ethernet_c,oqc_product_cstm.usb_c,oqc_product_cstm.zigbee_c,oqc_product_cstm.garantia_c,oqc_product_cstm.datafab_c,oqc_product_cstm.desccpu_coqc_product.name jt0.name accounts_oqc_product_namejtl0.accounts_oqctaccounts_ida accounts_oqctaccounts_idajt1.name relatedcategory oqc_product.relatedcategory_id CONCAT(IFNULL(jt2.first_name,''),' ',IFNULL(jt2.last_name,'')) personincharge oqc_product.assigned_user_id FROM oqc_product LEFT JOIN oqc_product_cstm ON oqc_product.id oqc_product_cstm.id_c LEFT JOIN accounts_oqc_product_c jtl0 ON oqc_product.id=jtl0.accounts_oqqc_product_idb AND jtl0.deleted=0 LEFT JOIN accounts jt0 ON jt0.id=jtl0.accounts_oqctaccounts_ida AND jt0.deleted=AND jt0.deleted=0 LEFT JOIN oqc_category jt1 ON oqc_product.relatedcategory_id jt1.id AND jt1.deleted=0 LEFT JOIN users jt2 ON oqc_product.personincharge_id jt2.id AND jt2.deleted=0 where (oqc_product.catalog_id like '609502e8-4884-8ca5-7b3e-49f7396733b8%') AND oqc_product.deleted=0 ORDER BY oqc_product.name ASC 
    The error is in the end, this command:
    (oqc_product.catalog_id like '609502e8-4884-8ca5-7b3e-49f7396733b8%') AND

    It should be blank there, no rule to apply to select a product catalog.

    Ok, now how do I change the code (which file) to erase that line from the select?

    Regards

  5. #5
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Popup windows search returning empty

    Actually I don't know the details regarding the Open Quotes and Contracts, so you should contact the maintainer of the project.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  6. #6
    leowolff is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    126

    Default Re: Popup windows search returning empty

    SOLVED, thanks a lot.

    The problem was with a flag in the product catalog module.

  7. #7
    pablovannini is offline Junior Member
    Join Date
    Sep 2007
    Posts
    3

    Default Re: Popup windows search returning empty

    Hi
    I have the same problem ¿what flag did you change?
    regards

  8. #8
    leowolff is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    126

    Default Re: Popup windows search returning empty

    Go to product catalog module, select the catalog that you are using, and make sure that the active checkbox is empty.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Returning custom field from module popup (JSON)
    By TheLetterM in forum Developer Help
    Replies: 5
    Last Post: 2009-04-29, 09:47 PM
  2. Empty config.php - FastStack Windows with MS SQL
    By erop in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2009-03-28, 02:46 PM
  3. Contacts Popup empty in 5.1
    By crazyivan in forum Help
    Replies: 3
    Last Post: 2008-10-29, 04:38 PM
  4. Targets advance search not returning any results
    By korazy in forum General Discussion
    Replies: 0
    Last Post: 2007-06-26, 06:17 PM
  5. Replies: 2
    Last Post: 2006-05-06, 01:24 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
  •