Skip to content
Snippets Groups Projects
Commit cfb39bf0 authored by Uma's avatar Uma
Browse files

Merge branch 'insert_role2picklist' into 'master'

Fixes #1323 saving role2 picklist values

See merge request !667
parents bea9f9fb 3781cd3d
No related branches found
No related tags found
No related merge requests found
Loading
  • Alan Lord @lord_alan ·
    Contributor

    @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.

  • Alan Lord @lord_alan ·
    Contributor

    @uma.s Question... Is there a reason you chose to use INSERT IGNORE? Why not use INSERT ON DUPLICATE KEY UPDATE instead? There three columns are the Primary key so I think this should work correctly.

  • Alan Lord @lord_alan ·
    Contributor

    @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)
  • Uma @uma.s ·
    Author Guest

    @lord_alan Thanks! for the confirmation, I will check through your observations.

  • Uma @uma.s ·
    Author Guest

    @lord_alan I noticed that with ON DUPLICATE KEY UPDATE query sortid column is inserted as 'NULL' Ref

  • Alan Lord @lord_alan ·
    Contributor

    @uma.s That's interesting. Thanks.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment