[Vtigercrm-developers] vtiger 6.5.0 code assumes order of Picklist table columns?

Alan Lord alanslists at gmail.com
Wed May 17 13:27:50 GMT 2017


I just had a weird one...

A customer said they were unable to delete a picklist value in the 
Picklist editor because some of the new values they added yesterday were 
not showing up as an option for the "Replace With" when deleting. Yet, 
the new values were clearly visible in the editor and in a module record.

Looking in the database, the order of the two columns `sortorderid` and 
`presence` were swapped around compared to other picklists and the 
values stored for these new entries were clearly wrong:

> 
> mysql> select * from vtiger_cf_887;
> +----------+-------------------------------------+----------+-------------+
> | cf_887id | cf_887                              | presence | sortorderid |
> +----------+-------------------------------------+----------+-------------+
> |        3 | CV received                         |        1 |           3 |
> |       22 | Banked                              |        1 |        4511 |
> |       10 | No response to Calls SMS Email      |        1 |        4480 |
> |       11 | Incorrect contact details           |        1 |        4481 |
> |       12 | No longer interested                |        1 |        4482 |
> |       13 | Waiting for CV                      |        1 |        4483 |
> |       14 | Not suitable                        |        1 |        4484 |
> |       15 | Initial Interview booked completed  |        1 |        4485 |
> |       16 | Employer Interview booked completed |        1 |        4486 |
> |       17 | Failed to attend interview          |        1 |        4487 |
> |       18 | Interview unsuccessful              |        1 |        4488 |
> |       19 | Interview successful                |        1 |        4489 |
> |       20 | Signup                              |        1 |        4490 |
> |       23 | Interested                          |        1 |        4687 |
> |       24 | Left Message to Call Back           |        1 |        4688 |
> |       25 | No response                         |        1 |        4689 |
> |       26 | Not Interested                      |        1 |        4690 |
> |       27 | In Different sector                 |        1 |        4691 |
> |       28 | Signed Up                           |        1 |        4692 |
> |       29 | INSUFFICIENT GRADES                 |        1 |        4693 |
> |       30 | Registered                          |     4694 |           1 |
> |       31 | Referred                            |     4694 |           1 |
> |       32 | CV Submitted                        |     4694 |           1 |
> |       33 | Interviewing                        |     4694 |           1 |
> |       34 | On Work Trial                       |     4694 |           1 |
> |       35 | Unable to Contact                   |     4694 |           1 |
> |       36 | Time Waster                         |     4694 |           1 |
> |       37 | New Test Value                      |     4694 |           1 |
> +----------+-------------------------------------+----------+-------------+
> 28 rows in set (0.00 sec)

Two things concern me here:

One, is that the presence column is described as int(1) so how on earth 
is is showing 4694,

> mysql> describe vtiger_cf_887;
> +-------------+--------------+------+-----+---------+----------------+
> | Field       | Type         | Null | Key | Default | Extra          |
> +-------------+--------------+------+-----+---------+----------------+
> | cf_887id    | int(19)      | NO   | PRI | NULL    | auto_increment |
> | cf_887      | varchar(200) | NO   |     | NULL    |                |
> | presence    | int(1)       | NO   |     | 1       |                |
> | sortorderid | int(19)      | NO   |     | 0       |                |
> +-------------+--------------+------+-----+---------+----------------+

Secondly, if I recorder the columns and fix the presence values, then 
the picklist editor works properly. This suggests to me that there is 
some code reading/writing to these tables which is simply assuming a 
specific column order...

Anyone got any thoughts or observations?

TIA

Al



More information about the vtigercrm-developers mailing list