Fatal error: Call to undefined function captcha_set_form_id_setting() in ...../modules/captcha/captcha.admin.inc on line 246

Comments

soxofaan’s picture

How did you get this error? Please provide steps to reproduce

The line from the error message is inside function captcha_admin_settings_submit(), which does not include the required include file (captcha.inc) itself, because this one is included by form builder function captcha_admin_settings(). Normally captcha_admin_settings() should always be run before captcha_admin_settings_submit(), so this problem should not manifest itself.

Observer123’s picture

I received it when submit changes in captcha settings. Was resolved entering the captcha_set_form_id_setting source code in captcha.admin.inc. Not sure is that right, but problem been resolved. I am new to php programing :)

soxofaan’s picture

Category: bug » support
Priority: Critical » Normal

I received it when submit changes in captcha settings.

I can't reproduce this. Can you describe your setup? E.g. what other modules are you using?

Note that the 6.x-2.1 version is already released for more than a month now and there are already more than 17000 users at the time of this writing (http://drupal.org/project/usage/672304). If the problem you mention is caused by the CAPTCHA module on its own, it would be reported much earlier and would be highly critical.
But since this is not the case, I suspect there is something wrong on your setup outside the CAPTCHA module.

Was resolved entering the captcha_set_form_id_setting source code in captcha.admin.inc.

This is not the right way to solve this, as captcha_set_form_id_setting is now defined in two places: captcha.inc and captcha.admin.inc, it's better to include or require (http://php.net/manual/en/function.require.php) captcha.inc .
But even that is not a real solution for your problem (you're just hiding the problem, not solving it)

brianmercer’s picture

Also having this problem.

FastCGI sent in stderr: "PHP Fatal error:  Call to undefined function captcha_set_form_id_setting() in /usr/local/drupal/modules/captcha/captcha.admin.inc on line 248" while reading response header from upstream, client: xx.xx.xx.xx, server: drupal-secure, request: "POST /admin/user/captcha HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "example.com", referrer: "https://example.com/admin/user/captcha"

It must have to do with my pseudo http://drupal.org/project/securepages setup that I'm doing through server rewrites. Normal pages are HTTP and admin pages are redirected to HTTPS. I expect that the POST is HTTP and not surviving the rewrite. My other sites which are totally HTTP or totally HTTPS do not have this problem on the same server.

Sort of an edge case, but I've run into very few problems with other modules.

brianmercer’s picture

OK, ignore that last post. I took out the HTTPS rewrites and it still does it. I'll keep looking.

brianmercer’s picture

Status: Active » Closed (fixed)

It was the http://drupal.org/project/form module. Form seems to be causing lots of problems, so almost certainly not a CAPTCHA issue.