change the username in the field labeled "Login username"
---> the user seems to lose all his entered data
change the username back to its original value
---> the data seems to "magically" reappear
What really happens is that when the user name is
changed, Timesheet forgets to update the attribute
"uid" in table timesheet_times with the new username.
Subsequent queries fail because the relationship
between timesheet_users and timesheet_times is broken.
Suggested solutions:
or
As to the 2nd solution: I would like to go even further
and suggest that all tables that reference
timesheet_users should use the numeric attribute "uid"
as their foreign key. Currently these are the tables
timesheet_assignments, timesheet_task_assignments and
timesheet_times. This would have the advantages
database takes up less space because a numeric ID is
almost always shorter than a string user name
PHP code becomes simpler because no update is
required in referencing tables when the user data changes
Logged In: YES
user_id=1330385
I have noticed this problem as well. Has anyone started on
the mods needed?
Logged In: YES
user_id=1330385
Quick and ugly fix, but I agree that the uid should be the key
for all tables.
//update the assignments
dbQuery("UPDATE
$ASSIGNMENTS_TABLE SET username='$username'
WHERE username='$data[username]'");
dbQuery("UPDATE
$TASK_ASSIGNMENTS_TABLE SET username='$username'
WHERE username='$data[username]'");
dbQuery("UPDATE
$PROJECT_TABLE SET proj_leader='$username' WHERE
proj_leader='$data[username]'");
//mod by ivan_nz 07-10-05
dbQuery("UPDATE
$TIMES_TABLE SET uid='$username' WHERE uid='$data
[username]'");
Logged In: YES
user_id=1330385
oops changes made to user_action.php