Results 1 to 2 of 2

Thread: Posible Bug: ListViewdefs with relationship field

  1. #1
    anotine is offline Member
    Join Date
    Feb 2011
    Posts
    6

    Default Posible Bug: ListViewdefs with relationship field

    - In a listviewdefs, no matter how you define your relationship identifying different field than name to show the object related, it will always show the concatenation of first_name y last_name.
    To avoid this, i found the Ligne: 3149 of data/SugarBean,php

    PHP Code:
    //if rnanme is set to 'name', and bean files exist, then check if field should be a concatenated name
    global $beanFiles$beanList;
                        
    if(
    $data['rname'] && !empty($beanFiles[$beanList[$rel_module]])) {
                                
                            
    //create an instance of the related bean
                            
    require_once($beanFiles[$beanList[$rel_module]]);
                            
    $rel_mod = new $beanList[$rel_module]();
                            
    //if bean has first and last name fields, then name should be concatenated
                            
    if(isset($rel_mod->field_name_map['first_name']) && isset($rel_mod->field_name_map['last_name'])){
                                    
    $data['db_concat_fields'] = array(0=>'first_name'1=>'last_name');
                            }
                        } 
    it should be:
    PHP Code:
    if($data['rname'] =='name' 
    did someone have this problem?

  2. #2
    anotine is offline Member
    Join Date
    Feb 2011
    Posts
    6

    Default Re: Posible Bug: ListViewdefs with relationship field

    I found that it did not solve entirely my problem, when name is customized to be c concat fields other that first_name and Last_name,
    so i change it to:
    PHP Code:
    /* BEGIN CHANGE
                             *  Eso permite recuperar db_concat_fields para name cuando hay*/                        
                            
    if ( isset($rel_mod->field_name_map[$data['rname']]) &&
                                  isset(
    $rel_mod->field_name_map[$data['rname']]['db_concat_fields'])){
                                
    $dbs_tmp $rel_mod->field_name_map[$data['rname']]['db_concat_fields'];
                                
    $data['db_concat_fields'] = $dbs_tmp;    
                            }
                            elseif (
    $data['rname']!='name'){
                            
                            }                        
                            else
                            
    /* END CHANGE*/
                                //if bean has first and last name fields, then name should be concatenated
                                
    if(isset($rel_mod->field_name_map['first_name']) && isset($rel_mod->field_name_map['last_name'])){
                                    
    $data['db_concat_fields'] = array(0=>'first_name'1=>'last_name');
                                } 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add field to relationship, and circular relationship
    By jhermiz in forum General Discussion
    Replies: 1
    Last Post: 2010-05-04, 08:34 PM
  2. Replies: 1
    Last Post: 2010-04-07, 04:09 PM
  3. Replies: 0
    Last Post: 2009-05-29, 11:09 AM
  4. ¿Es posible?
    By eldire in forum Español
    Replies: 3
    Last Post: 2009-02-13, 08:17 PM
  5. Add related field to listviewdefs.php
    By Meex21 in forum Developer Help
    Replies: 2
    Last Post: 2009-02-10, 01:45 PM

Tags for this Thread

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
  •