Skip to content

vt7.1 - vtlib/Vtiger/Field.php - Vtiger_Field->setRelatedModules adds SELECT action by default when adding a related list which does not work

When using Vtiger_Field->setRelatedModules, when it creates a related list, it does $actions = $moduleModel->getRelationShipActions(); on line 187

however this always returns ADD and SELECT as actions. SELECT is only applicable to Many:Many relationships - however on the next line, it calls setRelatedList() and passes the function_name as 'get_dependents_list' which is the function used for populating related lists that are 1:Many relationships (which if your using a UIType 10 field is appropriate).

This causes the SELECT button to be displayed, however it does not work, as it creates an entry in the crm_entityrel table which the get_dependents_list does NOT reference.