User Anonymous
Location http://www.example.com/user/register
Referrer http://www.example.com/user
Message array_merge() [function.array-merge]: Argument #2 is not an array in /home/mydir/public_html/drupal-5.1/sites/all/modules/captcha/captcha.module on line 195.
Originally this site was running Drupal 4.7 and captcha worked fine. Started getting this error when I upgraded to drupal 5.1 and captcha 5.x-2.1. Then upgraded to 5.x-2.2 but still no luck.
On Admin>Site Config>Captcha config page, I have
Captcha points for the role anonymous user:
Comment form - Captcha/Math
Contact form - Captcha/Math
Sitewide Contact form - Captcha/Math
I don't have the Form Store module (is that required? it's not listed as a requirement in the .info file)
On the old 4.7 site, I had (and still would like) captcha on the user registration form and user edit form, but I don't see that option anymore.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | captcha.php52.patch | 1.08 KB | mathieu |
Comments
Comment #1
skor commentedMore info:
I don't get this error on my test site which runs PHP 4.4.2/MySQL 4.1.21
I do get it on my production site which runs PHP 5.1.4/MySQL 5.0.24
Comment #2
skor commentedFor now, I've downgraded my production site to 5.x-1.1.
Any significant downside to that?
Comment #3
leoklein commentedI've downgraded to 5.x-1.1 as well. Works for me (as far as I can tell).
Comment #4
soxofaan commentedIf you don't mind trying out patched versions have a look at http://drupal.org/node/153395 , the last version at the time of this writing is at http://drupal.org/node/153395#comment-264105
Comment #5
robomalo commentedI changed line 195 from
$form = array_merge($form,$result['form']);to
$form = array_merge($form,(array)$result['form']);This seems to work for me. With this change, this is the first release that has worked for our site since 5.x-1.1.
Comment #6
robomalo commentedI lied, sorry. I spoke way too soon. I just noticed the error was gone. The entire question is gone now. Going back to 5.x-1.1...
Comment #7
skor commented@soxofaan - I'll have a chance to try out your update later this week (possibly thurs).
It's still not clear to me if the Form Store module is required for the 5.x-2.x branch. It isn't listed as a dependancy in the .info file, but and I'm not sure what to make of this
Comment #8
soxofaan commentedthanks
form_store is not required to run the captcha module if its default captcha points (forms where a captcha should be enabled) are all you need. If you want captcha's on other forms, you need form_store and form_collect to collect these forms and add them to the captcha interface.
PS: My rewrite of captcha (http://drupal.org/node/153395#comment-264105) has no dependencies (except drupal ;) ).
Comment #9
skor commentedOK, finally got my dev site updated to php5 today, and verified that the error happens with php5 (but not php4)
Should have some time to try the patch tomorrow evening.
Comment #10
skor commentedOK, so after updating to php5 to get the error, I downgraded to 5.x-1.1, disabled all captcha points, then upgraded to 5.x-2.2, and re-enabled some of the default captcha points. No errors.
Then I installed the form_store module, and enabled captcha on the account registration form. No errors.
So this bug is simply the result of poor upgrade path. I think I only got it because with 5.x-1.1 I had captcha enabled for new account registrations, which is not supported in 5.x-2.2 without form_store.
Possible solutions
Comment #11
twohills commented+1 here.
Captcha 5.x-2.2
Drupal 5.x-dev (2007-Jun-20)
I don't think this is an upgrade error. i deleted all captcha variables and re-enabled - still had the problem
This error disables user/password and user/registration forms, even when no captcha point is set for them!
Comment #12
sigfredo commentedHi I hope that this infrmation may help to solve the bug. I have installed Captcha module on my drupal 5.1 site, I got the error Argument#2 not an array in captcha.module line 195his error. It happened wiith PHP 5.2.2. After reviewing the posts here I have downgraded PHP to Version 4.4.7 and the captcha module begin working fine, without problems, and without doing anythisng else you can see it at http://www.transformando.info.
Comment #13
skor commented@twohills - Did you downgrade to captcha 5.x-1.1 before disabling all captchas, and then upgrading to 5.x-2.2? That worked for me. Then once you're back up to 5.x-2.2, you'll need form_store module to get captchas for user/registration and user/password.
Alternatively, you could try just installing the form_store module and see if that fixes it.
Another option (possibly 5.x-3.x) is being worked over here: http://drupal.org/node/153395
Comment #14
mathieu commentedHere's a patch that hopefully solves this bug (it does for me, with PHP 5.2). This patch is agains 5.x-3.x-dev. This is a fairly simple patch, I just hope I read this bug report correctly and that I had the same problem as everybody else.
Comment #15
wundo commentedComment #16
robloachDo you still experience this with the latest 3.x-dev?
Comment #17
gregglesfwiw, I don't think this is sitll a problem. I've upgraded recently and didn't experience this problem.
Comment #18
robloachThanks!
Comment #19
(not verified) commented