Results 1 to 4 of 4

Thread: Possible bug with list view and certain joins

  1. #1
    FokeyJoe is offline Junior Member
    Join Date
    Aug 2008
    Posts
    1

    Default Possible bug with list view and certain joins

    I think I've found an issue in the list view code whilst working on some custom modules (hence I can't say for sure if this is reproduceable in all given situations).

    SugarCRM v5.1.0RC
    Steps to reproduce:
    1. in moduleBuilder, created new module based on Basic. Deploy it.
    2. go into accounts and create one-to-many relationship with new module
    3. create some new module entries, going via the accounts screen
    4. Set list view to show only name and assigned to fields

    What happens is that the module entries won't display in the list view of the module because the list query is all messed up. I've tracked this down to it doing a strange bit of SQL in SugarBean::create_new_list_query(). Around line 3208-3210, this is where it checks for related fields that aren't many-to-many. It reaches a !$table_joined check and when it goes in it does this line:
    Code:
    $ret_array['from'] .= ' ' . $join['join']. ' AND ' . $params['join_table_alias'].'.deleted=0';
    so at the end of create_new_list_query(), $ret_array looks like this (amisc is my module name):
    Code:
    array(5) { ["select"]=>  string(91) " SELECT amisc.id , amisc.name , jt0.user_name assigned_user_name, amisc.assigned_user_id " ["from"]=>  string(31) " FROM amisc AND jt0.deleted=0" ["from_min"]=>  string(12) " FROM amisc " ["where"]=>  string(22) " where amisc.deleted=0" ["order_by"]=>  string(0) "" }
    This is wrong in 2 ways, it doesn't add a join with the jt0 table, and it adds a where clause to the from field.
    The workaround is to simply not display the assigned to field in this situation. I have not investigated this fully as I don't need this field, but as it took long enough to find and is in base code I thought it was worth publishing.
    It's possible that it's the result of the moduleBuilder not establishing a proper relationship with the user information, or in the way I've created my custom module.
    Last edited by FokeyJoe; 2008-08-27 at 10:21 AM. Reason: added extra note about modulebuilder possibly being the fault

  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: Possible bug with list view and certain joins

    We just posted 5.1.0 GA. Can you reproduce this issue in the GA build?
    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
    fjrey is offline Junior Member
    Join Date
    Mar 2008
    Posts
    3

    Default Re: Possible bug with list view and certain joins

    Hi,

    Probably this bug is related to this post, http://www.sugarcrm.com/forums/showthread.php?p=127020#post127020, let me know your opinion.

    Is there the 5.1 GA also for the enterprise edition?

    Where can I download it?

    Regards

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

    Default Re: Possible bug with list view and certain joins

    Quote Originally Posted by fjrey
    Hi,

    Probably this bug is related to this post, http://www.sugarcrm.com/forums/showt...020#post127020, let me know your opinion.

    Is there the 5.1 GA also for the enterprise edition?

    Where can I download it?

    Regards
    The Sugar Enterprise Edition 5.1 is available for download from http://support.sugarcrm.com. You will need to be logged into sugarcrm.com with the user id that has credentials to access the software. Contact your SugarCRM sales rep if you don't have access to the software.
    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)

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
  •