Skip to content

vtlib - Field -> setRelatedModules() does not create relatedList when passed a Label

In vtlib/Vtiger/Field.php the function setRelatedModules() will accept an associate array as well as an enumerative array, with the intention that when passed an associate array, it will use the key as a Label to create a related list in the Related Module. E.g.

$field1->setRelatedModules( Array('Contacts'=>'Accounts')) should create a relatedlist in Contacts module labelled 'Accounts' (the field was created in Accounts module).

However it seems to fail when trying to call Vtiger_Module_Model::getRelationshipActions() and will never create the related list. (If we take out the 2x lines to call getRelationshipActions and just substitute an Array('ADD','SELECT') it works correctly.)