Merge branch 'insert_role2picklist' into 'master'
Fixes #1323 saving role2 picklist values See merge request !667
-
@uma.s Just one more thing - if a user removes all picklist options from a Role the $insertValueList will be empty and therefore should be checked also.
-
@uma.s Question... Is there a reason you chose to use
INSERT IGNORE
? Why not useINSERT ON DUPLICATE KEY UPDATE
instead? There three columns are the Primary key so I think this should work correctly. -
@uma.s Yes - this does work - I just tested it:
INSERT INTO vtiger_role2picklist (roleid,picklistvalueid,picklistid) VALUES ("H17","1569","154"),("H17","2017","154"),("H17","2016","154"),("H17","1579","154"),("H17","1578","154"),("H17","1577","154"),("H17","1576","154"),("H17","1575","154"),("H17","1574","154"),("H17","1573","154"),("H17","1572","154"),("H17","1571","154"),("H17","1570","154"),("H17","1222","154"),("H17","1568","154"),("H17","1567","154"),("H17","1566","154"),("H17","1565","154"),("H17","1564","154"),("H17","1563","154"),("H17","1562","154"),("H17","1561","154"),("H17","1225","154"),("H17","1224","154"),("H17","1223","154") ON DUPLICATE KEY UPDATE roleid = VALUES(roleid), picklistvalueid = VALUES(picklistvalueid), picklistid = VALUES(picklistid)
-
@lord_alan Thanks! for the confirmation, I will check through your observations.
-
@lord_alan I noticed that with ON DUPLICATE KEY UPDATE query sortid column is inserted as 'NULL' Ref
-
@uma.s That's interesting. Thanks.