declare #validate and #submit for consistency

skizzo - October 17, 2009 - 12:38
Project:Secure Site
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I am getting the following error on the login page when Securesite is enabled.
Apart from that I don't notice any adverse effect.

warning: array_unshift() [function.array-unshift]: The first argument should be an array in /var/www/drupal/sites/all/modules/logintoboggan/logintoboggan.module on line 191.

#1

hunmonk - October 17, 2009 - 14:20
Title:watchdog error(first argument should be an array)» declare #validate and #submit for consistency
Project:LoginToboggan» Secure Site
Version:6.x-1.6» 6.x-2.x-dev

meh, i knew i should have coded more defensively there...

i put in some paranoid checks in LoginToboggan to avoid this issue in the future.

incidentally, that error does break LT's validation handler, which would be a problem if you have 'Login with e-mail' set.

the problem is securesite's implementation of the login form, securesite_user_login(&$form_state). it doesn't declare any #submit or #validate handlers at all in the form.

i would recommend that function be patched to at least include empty arrays for #validate and #submit -- most other modules are probably expecting those to be arrays.

attached patch for the 6.x-2.x branch does this.

AttachmentSize
securesite_declare_handlers.patch 728 bytes

#2

hunmonk - October 17, 2009 - 14:33
Priority:minor» normal
Status:active» needs review

#3

skizzo - October 17, 2009 - 18:14

Patched. Should this issue be moved to the Secure site queue?

#4

hunmonk - October 19, 2009 - 04:34

@skizzo: it's already in the Secure Site queue -- read the metadata table at the top of the issue...

 
 

Drupal is a registered trademark of Dries Buytaert.