Closed (fixed)
Project:
CAPTCHA
Version:
5.x-2.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2007 at 01:00 UTC
Updated:
19 Sep 2007 at 08:42 UTC
First of all, after going to the registration page, I get this in my apache error log:
[error] PHP Fatal error: Cannot use string offset as an array in /sites/all/modules/captcha/captcha.module on line 166
thus, I can not reach the registration page...
And on the "Administer / Site configuration / Captcha" page, the "Captcha Points" tab shows nothing, it's empty.
--
Daniel
Comments
Comment #1
bryansd commentedI'm seeing the same error here too. For me this is an upgrade from a previous version of captcha.
Comment #2
Farreres commentedsame problem here.
Comment #3
VDG commentedI got this module working by changing the "+=" on line 194 into ".=". Captcha points never show up, but you can add some more in the function _captcha_points(). Change "if($captcha_points == NULL)" in the same function to "if($captcha_points != NULL)" and load the captcha-settings page. All additions should be configurable. Now change the "!=" back to "==" and you're set to go.
Comment #4
VDG commentedOK, seems all this is not necessary. You just need the "form store" module to get the captcha points right. Only problem now is the captcha never seems to validate...
Comment #5
VDG commentedOK, got it working:
- Get the "form store" module and make it add the necessary fields
- If you use the guestbook-module, then go to your database, "variable" table, "name" field and change the type to at least varchar(52) or some name fields will not fit
- Change guestbook_form_entry_form_submit to guestbook_form_entry_form_validate in guestbook.module (really messy, I know)
Now you should be able to add some captcha points.
Comment #6
pyutaros commentedSo is the general consenus here that the only way to get version 2.0 working is by installing another module?
Comment #7
Farreres commentedIf installing another module is the way to go, the dependency should be marked in the module info file.
Comment #8
VDG commentedCorrect. I only found out by accident (looking for the string "captcha" on the modules page). An update of the captcha-page could be handy as well.
As for the line 166 issue, you might have better luck applying this patch.
Comment #9
WebWeasel commentedI'm getting "Fatal error: Unsupported operand types in /var/www/htdocs/drupal5/sites/all/modules/captcha/captcha.module on line 194" on any page that tries to display a captcha.
Comment #10
GoofyX commentedWebWeasel, see comment #3.
Comment #11
VDG commentedActually, you don't need to change the code, just installing form_store should be enough - as long as you don't use the guestbook module.
Comment #12
GoofyX commentedBut the += is wrong, right? Shouldn't it be .= ?
Comment #13
VDG commentedNo, I'm using it almost 'as is' without any problems. The only thing I changed, is this patch, which should not be related to your issue. This patch should also prevent "indefinite" dissapearance of the captcha after the first correct answer.
Comment #14
Farreres commentedPlease, could this patch be applied and a new corrected official version be created?
Comment #15
GoofyX commentedOK, using VDG's patch seems to work along with the form store module. There's no need to change the += operator to .= in line 197 (version 2.1).
However, in case the contact core module is enabled and you try to contact a user from his profile by clicking on the Contact tab, then you get the "Unsupported operand types" error.
Comment #16
mgiffordThis change helps avoid the white screen of death that you get with an unsuported operand type:
http://drupal.org/node/145509
However there does need to be a better solution as captcha just isn't working for me (and from the sounds of it for a lot of other folks too).
Mike
Comment #17
pobster commented+= is perfectly valid php;
Pobster
Comment #18
mgiffordYes, but your example is with variables and not with arrays. I haven't been able to track down why this unsupported operand types error is coming up, but it does and it is bringing my site down when I use captcha (and other folks too). I think the problem is either to do with the value not being set before hand or trying to add a string to an array.
Comment #19
BradM commentedAll this talk sounds like Greek to those of us non-coders. Reverting back to and older version until this mess can be figured out.
Comment #20
mgiffordI added in the latest form_store module and that seemed to have straightened out the issues I was having.
Mike
Comment #21
robloachFixed in the 3.x branch.
Comment #22
(not verified) commented