[Vtigercrm-developers] I must be missing something ...

Andrew Rodes arodes at onweald.com
Sat Dec 22 10:19:44 PST 2007


Ok, so I don't remember this being broken, and I have scoured the forums to
no avail.

 

I am having a problem importing custom fields into accounts.

 

I found the function where the problem is occurring, but its so blatent, I
cant imagine I am correct.

 

Basically, in CustomFieldUtil.php there is a function which is called during
the import. The function is as follows:

 

function getCustomFieldArray($module)

{

            global $log;

            $log->debug("Entering getCustomFieldArray(".$module.") method
...");

            global $adb;

            $custquery = "select * from vtiger_field where
tablename='".$module."'";

            $custresult = $adb->query($custquery);

            $custFldArray = Array();

            $noofrows = $adb->num_rows($custresult);

            for($i=0; $i<$noofrows; $i++)

            {

 
$colName=$adb->query_result($custresult,$i,"column_name");

                        $custFldArray[$colName] = $i;

            }

            $log->debug("Exiting getCustomFieldArray method ...");

            return $custFldArray;

            

}

 

However, on the line:

$custquery = "select * from vtiger_field where tablename='".$module."'";

 

the variable $module, always comes in as the expected "Accounts"

 

However, in the vtiger_field table the values stored in the tablename column
are all as expected such as: vtiger_account etc

 

So this query returns NO custom fields for the module, and the import
fails.(actually it returns success, but the record doesn't show up in the ui
since no custom field entries were made for it)

 

ANY IDEAS? If not .. I will try to look for an elegant fix and share it (not
sure where to get the table name for the given module .. sure its somewhere)

 

 

Thanks,

 

Andy

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20071222/fe37847a/attachment-0003.html 


More information about the vtigercrm-developers mailing list