I had to comment out this line for me to not get a fatal error:
if($_SESSION['captcha'][$seed]['success'] === TRUE)

Not sure if it is working now or not.

[Thu May 10 00:11:17 2007] [error] [client 64.230.47.73] PHP Fatal error: Cannot use string offset as an array in /home/drupal/modules/captcha/captcha.module on line 166

I just upgraded this to the latest version since someone was having trouble with the math queries on my comments.

Comments

VDG’s picture

mgifford’s picture

I just reverted to the old version of captcha - buggy as it may be.

site got the wsod earlier today due to:

[Thu May 10 12:23:49 2007] [error] [client 64.230.47.73] PHP Fatal error: Unsupported operand types in /home/dm_50/sites/all/modules/captcha/captcha.module on line 194, referer: http://openconcept.ca/

VDG’s picture

Steps to reproduce? Did you install the form-store module?

BradM’s picture

patch didn't work for me, all it did was give me a different error message now.

Fatal error: Unsupported operand types in /path/to/modules/captcha/captcha.module on line 197

Line 197:
$form['#validate'] += array('captcha_validate' => array());

mgifford’s picture

I had installed the form_store module. Just upgraded it to the latest version, tried it again and it seems to be working now (which is great).

Mike

imp_squared’s picture

I try the patch above.. but still get "Cannot use string offset as an array" resulting from these lines.

200 $_SESSION['captcha'][$seed]['success'] = FALSE;
201 $_SESSION['captcha'][$seed]['form_id'] = $form_id;
202 $_SESSION['captcha'][$seed]['form'] = $result['form'];
203 $_SESSION['captcha'][$seed]['new_value'] = $result['value'];
204 $_SESSION['captcha'][$seed]['preprocess'] = isset($result['preprocess'])? $result['preprocess'] : FALSE;
205 $_SESSION['captcha'][$seed]['module'] = $challenge[0];
206 $_SESSION['captcha'][$seed]['type'] = $challenge[1];

there are more of these type of lines in the number lines below these ones.

I'm using the following:
- Drupal v5.1
- Form Store & Form Collect v5.x-1.0
- Captcha v5.x-2.1

also applied patch "captcha.inc__1.patch" from this post: http://drupal.org/node/143778#comment-247398

Thanks

mfer’s picture

Version: 5.x-2.0 » 5.x-2.1

This seems to stem from the issue that $seed is grabbed from the token in the form and for anonymous users there is no token in the comment form. did a print_r($form) and found no token for the picking. All the errors (except the +=) seem to come from that.

This is a serious issue that needs a litle fixing.

mgifford’s picture

Are you using the latest version of form_store? Any page with a newsletter wasn't working before I added the latest version of the form store module and added the simplenews block to the list of forms.

mfer’s picture

My issue is with anonymous comments. If you do a print_r($form) you'll find that anonymous users don't have a token to be read in and that's what's creating a bunch of the problems, i think.

mrgoltra’s picture

another option is reCaptcha module which was released yesterday.

mrgoltra’s picture

sorry I posted in the wrong area. how can I delete

mgifford’s picture

mrgoltra, Unfortunately you can't delete or edit posts.

mefer, I don't know enough about the token that is supposed to be passed to know if this would have an effect or not. I just know it works now and didn't previously.

stella’s picture

Priority: Normal » Critical

subscribing

stella’s picture

FYI, marked #145904 as a duplicate of this issue

Gábor Mayer’s picture

Fatal error: Cannot use string offset as an array in /home/www/drupal/modules/captcha/captcha.module on line 169

slavikt’s picture

So...
Is there any way to fix this problem?

mfer’s picture

wundo says there is a fix on his dev machine at home.... just hasn't posted it yet.

mariuss’s picture

Having the exact same issue. And it is sort of random. It will happen from certain browsers only.

HorsePunchKid’s picture

Version: 5.x-2.1 » 5.x-2.2

Subscribing; same problem as #15 reports.

robloach’s picture

Status: Active » Closed (fixed)

I believe this issue was taken care of.