If 2 users submit a claim on a node and I decline the first, then accept the second I get the following error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '34-149' for key 1: UPDATE {nodeownership} SET uid=:db_update_placeholder_0 WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 34 [:db_condition_placeholder_0] => 149 ) in _node_claim_process() (line 416 of /websites/onedge/modules/nodeownership/nodeownership.module).

Comments

SomethingOn’s picture

It looks like the code on line 411 through 416 is totally unnecessary:

$num_updated = db_update('nodeownership')
      ->fields(array(
        'uid' => $uid,
      ))
      ->condition('nid', $nid, '=')
      ->execute();
gauravkumar87’s picture

Assigned: Unassigned » gauravkumar87
gauravkumar87’s picture

Assigned: gauravkumar87 » yogeshchaugule8
Status: Active » Needs review

Fix committed to the latest dev snapshot. Yogesh, please verify.

Gaurav

yogeshchaugule8’s picture

Status: Needs review » Closed (fixed)

works as expected