[Vtigercrm-developers] vtlib, setRelatedModules() associative array does not create a related list.

Alan Lord alanslists at gmail.com
Mon Oct 29 17:35:57 GMT 2018


On 29/10/2018 16:52, Martin Allen wrote:
> If you look at the code in vtlib, it defaults the related list function 
> to get_dependents_list, and inserts the field id of the related field 
> that we just related to this module.

Not in vtiger 7.1.1:

  function setRelatedList($moduleInstance, $label = '', $actions = 
false, $function_name = 'get_related_list', $fieldId = null) {

get_related_list is suitable for the n:n relationship using the 
vtiger_crmentityrel table.

> It also /attempts /to get the actions (Add & Select) using the call to 
> Vtiger_Module_Model::getRelationshipActions() which /should/ return 
> Array('ADD','SELECT')

If you wanted to use get_dependents_list then SELECT will not work as 
this implies you would be replacing the value in the source field of the 
record being selected; and vtiger has no way of dealing with that at the 
moment anyway.

Still not sure what benefit there would be of using an associative array 
as you originally suggested. With the changes since v6 vtiger supports 
having multiple related lists of the same module (maybe with different 
functions or from a different source field) - using your mechanism would 
not work at all in that scenario.


Al



More information about the vtigercrm-developers mailing list