Migration script breaks vtlib module related lists in 660_to_700.php
This line causes several of my vtlib based custom modules which have a related list in the Accounts module to no longer work...
http://code.vtiger.com/vtiger/vtigercrm/blob/master/modules/Migration/schema/660_to_700.php#L112
For modules related to Accounts, this line of code replaces every get_dependents_list function name in vtiger_relatedlist with get_merged_list. However, get_merged_list depends on that lovely piece of a hardcoded nightmare which is vtlib_setup_modulevars... Of course, any custom vtlib created module will not exist in this function and its protected source __vtlib_get_modulevar_value().
So if you have a custom vtlib module which has a related list, based on a UI10 field, with the Accounts module, then after migrating to v7 the related list will not work*.
The easiest solution is to go back and replace the function names in vtiger_related_list with the original get_dependents_list which still work.
I guess one could possibly modify the $related_module_table_index array in the Accounts.php class (which is not ideal obviously) to include the custom module's table relationship but it is not clear from the code if this would work and I don't have time to test it.
- This is what happens to the query (because this code doesn't work
vtlib_setup_modulevars($related_module, $other);)
:
Mon Jun 4 12:25:53 2018,452 [21441] INFO VT - PearDatabase ->ADODB error Query Failed:SELECT DISTINCT vtiger_crmentity.crmid,libertus_lsaddresses.addressno, libertus_lsaddresses.buildnum, libertus_lsaddresses.city, libertus_lsaddresses.postcode, libertus_lsaddresses.lsaddresstype, vtiger_crmentity.smownerid FROM libertus_lsaddresses INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = libertus_lsaddresses.lsaddressesid LEFT JOIN libertus_lsaddressescf ON libertus_lsaddressescf.lsaddressesid = libertus_lsaddresses.lsaddressesid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid WHERE vtiger_crmentity.deleted = 0 AND ( (libertus_lsaddresses.relatedtolink = 4491228) OR (. IN (4491229,4491230)) ) LIMIT 0,20::->[1064]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN (4491229,4491230)) ) LIMIT 0,20' at line 1