Closed (won't fix)
Project:
Password reset
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Dec 2007 at 10:08 UTC
Updated:
17 May 2008 at 21:21 UTC
The function password_reset_user() is running a query on the /user/uid page load that doesn't seem like it needs to run. On my end it is loading this query anywhere between 20ms to 1400ms. Did you really intend for this to run when a user is visiting their /user/uid page? This only happens when visiting their own page.
When $op = update you have the following which is creating the query:
case 'update':
$qid = $edit['password_reset']['question'];
$answer = trim($edit['password_reset']['answer']);
unset($edit['password_reset']);
// MySQL-only query.
db_query("REPLACE INTO {password_reset_users} (uid, qid, answer) VALUES (%d, %d, '%s')", $account->uid, $qid, $answer);
break;
Comments
Comment #1
Zen commentedAre you saying that
"REPLACE INTO {password_reset_users} (uid, qid, answer) VALUES (%d, %d, '%s')"is slow? I don't see why it would be. It should also only be triggered when the user edit form is submitted.Incidentally, the REPLACE query should be replaced by a DELETE + INSERT :|
Comment #2
elvis2 commentedI guess slow can be defined by many things. But, it should not be taking place when "viewing" the user/ page, when logged in and visiting your own user page... Maybe another case needs to be added
Comment #3
Zen commentedI cannot reproduce the issue. Please test on a fresh checkout.
Comment #4
elvis2 commentedIt might be worth mentioning I am redirecting a user to a different tpl in my template.php file like so:
I am not sure if that would change anything, but I thought I would mention it.
Comment #5
Zen commentedCannot reproduce.