ID has to be unique

This commit is contained in:
jelhan 2014-02-21 19:08:27 +01:00
parent a1e4a1da84
commit fb21d679c6
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ switch ($_SERVER['REQUEST_METHOD']) {
$newData = json_decode($data);
$newData->user->id = $newId;
foreach ($newData->user->selections as $k => $v) {
$newData->user->selections[$k]->id = $poll_id + $k;
$newData->user->selections[$k]->id = $poll_id + $user_data->user->id + $k;
}
$newData = json_encode($newData);
break;

View file

@ -95,7 +95,7 @@ class datahandler {
// extend id to all selection objects
foreach ($user_data->user->selections as $k => $v) {
$user_data->user->selections[$k]->id = $poll_id . $k;
$user_data->user->selections[$k]->id = $poll_id . $user_data->user->id . $k;
}
// embedd user into poll