vt7: Ajax call to getRelatedRecordsCount fails
This is really odd.
When the Detail View page loads and the Ajax call to the action RelatedRecordsAjax with a mode of getRelatedRecordsCount runs, I was seeing a php "warning" that reads:
Warning: Invalid argument supplied for foreach() in /var/www/vt7/modules/Vtiger/models/Module.php on line 600
Now in this method, it is looking for the CRMEntity->list_fields_name and list_fields vars. These are no longer used anywhere else as far as I can tell since Related List fields were handled by the Summary/Key fields settings. It also begs the question why these fields are even needed when this request should only be wanting to get the total number of related records???
In some custom modules of mine if I simply add
var $list_fields = Array(
'Assigned To'=>Array('vtiger_crmentity'=>'smownerid')
);
var $list_fields_name = Array(
'Assigned To'=>'assigned_user_id'
);
to the top of my module's class file this warning goes away and the counts are displayed. If these vars do not exist then the count display fails.
One of these related modules is actually rather custom and is an "extension" module which doesn't really have any vtiger "fields" anyway, so the data in these vars seems to be completely unimportant in terms of being necessary to calculate the count!