Closed (fixed)
Project:
Guestbook
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2011 at 10:58 UTC
Updated:
20 Feb 2013 at 00:34 UTC
/**
* Form validation function for guestbook_form_entry_form.
*/
function guestbook_form_entry_form_validate($form, &$form_state) {
// Check whether name of anonymous user is an registered user's name.
if (isset($form_state['values']['anonname'])) {
if ($existing = user_load(array('name' => $form_state['values']['anonname']))) {
form_set_error('anonname', t('%name is a registered user name. Please enter a different name.', array('%name' => $form_state['values']['anonname'])));
}
}
}
Why do we have to do this?
It causes a problem for anonymous users - they have to waste time picking available name.
Comments
Comment #1
parasolx commentedThrough logical, its correct not to waste time by checking all username currently registered in system. But it may cause a conflict in identification once a duplication name for anon appear same with registered user.
So i think it should and must have this counter check. However, this make even a registered user didn't pass to submit any comment since system detect the name already in database.
So, i manage to modified the operator to bypass this check when user is login.
At line of
change it to:
Comment #2
aexchecker commentedBetter use
!empty(), see patch for http://drupal.org/node/1467828#comment-5686556Comment #3
parasolx commentedArgh.. i don't think by using !empty much more appropriate.
Thanks.
Comment #4
quotesbro commentedComment #5
aexchecker commentedwas fixed in http://drupal.org/node/1467828#comment-5686556