vt701: Editing a Role-based picklist can crash the module
On demo.vtiger.com
Go to any module layout editor. Add a picklist (I used a muti-select combo). Add a few values. Save it.
Go to the list view of the module you just added that field to. All OK.
Now go to the Picklist editor and remove all the values from your Role (on the demo this was CEO). Save it.
Now try to load a list view of the module. You get a white screen of death.
This is due to the following:
SELECT cf_1456, color FROM vtiger_cf_1456 WHERE cf_1456 IN ()
Thu Jun 29 14:59:43 2017,859 [19992] INFO VT - PearDatabase ->ADODB error Query Failed:SELECT cf_1456, color FROM vtiger_cf_1456 WHERE cf_1456 IN ()::->[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 ')' at line 1
I believe the error comes from the code in modules/Vtiger/models/Field.php in the getPicklistColours() function.
Probably the
if (is_array($picklistValues)) {
should be something like:
if (is_array($picklistValues) && count($picklistValues)) {
I guess.