[Vtigercrm-developers] vtlib changes in 5.4.0???

Alan Lord (News) alanslists at gmail.com
Fri Apr 20 09:05:07 PDT 2012


Hi,

We are building some custom modules for a new customer and my dev tests 
in 5.4.0RC were going OK.. Having just tried to run the same code on a 
clean 5.4.0 system & database, creating picklist fields is causing a 
problem.

For example... below we are modifying the Account module.

// Get a handle to the accounts module
$module = Vtiger_Module::getInstance('Accounts');

// Add new block
$block_f1 = new Vtiger_Block();
$block_f1->label = 'F1 Information';
$module->addBlock($block_f1);

// Type picklist array
$type_array = array('Institute', 'Department', 'Lab', 'Consortium');

$field_inst_type = new Vtiger_Field();
$field_inst_type->name = 'f1insttype';
$field_inst_type->label= 'Institute Type';
$field_inst_type->table = 'vtiger_accountscf';
$field_inst_type->column = 'f1insttype';
$field_inst_type->columntype = 'VARCHAR(100)';
$field_inst_type->uitype = 15;
$field_inst_type->typeofdata = 'V~O';
$block_f1->addField($field_inst_type);
$field_inst_type->setPicklistValues($type_array);


The Block and fields are created as I would expect but all the picklists 
are empty. The tables are being created, in the above case the table 
vtiger_f1insttype (and the _seq) is created but does not contain the 
contents of the array. The table is empty :-(

This exact same code worked in 5.4.0RC.

Any ideas?

Thanks

Al


-- 
Libertus Solutions
http://www.libertus.co.uk



More information about the vtigercrm-developers mailing list