When I edit an existing casetracker node which has revisions active by default the form save causes a MySQL warning:
user warning: Duplicate entry '3064' for key 'PRIMARY' query: UPDATE casetracker_case SET nid = 369, vid = 3064, pid = 225, assign_to = 0, case_priority_id = 1, case_type_id = 9, case_status_id = 4 WHERE nid = 369 in /var/www/html/atrium-1-0-beta9/includes/common.inc on line 3538.
Looking at the asetracker_case table directly i cannot see any vid duplicates.
The data does get saved to the database and is visible if i re-edit the node, but the warning to end users isn't ideal.
Comments
Comment #1
buddaLine 163 of case tracker module should be:
Thanks to Snufkin for the suggestion of swapping the values.
Comment #2
snufkin commentedWhats the point of using this ternary operator there? If revision is off then nid and vid will simply be the same, if its on then the keys should be nid AND vid anyway.
I'd suggest removing the ternary operator and using
drupal_write_record('casetracker_case', $record, array('nid', 'vid'));on line 158 of casetracker.module.Comment #3
buddaAttached patch.