This was originally reported at the hidden captcha queue: #1277872: Getting errors AFTER disabling the module but Alexis thinks this is a CAPTCHA issue.

Summary: I disabled hidden captcha and afterwards (after cache flushes) I got those errors: CAPTCHA problem: unexpected result from hook_captcha() of module hidden_captcha when trying to retrieve challenge type Hidden CAPTCHA for form user_login_block.

Hidden CAPTCHA was set to be used on this form and after disabling it the setting correctly reverted to "default" (i.e. image captcha). Instead of using the "default" CAPTCHA seemed to try to use the former setting which obviously failed due to the disabled module.
I followed Alexis' advise and changed this setting once and afterwards everything worked fine again.

I failed to test on the other forms where hidden captcha was used but I suspect the behavior is independent from the user_login_block.

Comments

dddave’s picture

Title: CAPTCHA wants to use disabled hidden CAPTCHA on user_login_block » CAPTCHA wants to use disabled hidden CAPTCHA

...

soxofaan’s picture

Title: CAPTCHA wants to use disabled hidden CAPTCHA » Better handling of unavailable challenge type after disabling challenge module.
Component: Captcha API (captcha) » User interface
Category: bug » feature
Issue tags: +low-hanging fruit

This is, in a sense, expected behavior: when you disable the hidden CAPTCHA module, the code can not be reached anymore, but the CAPTCHA module had stil pointers to it, so that is why you get the error "CAPTCHA problem: unexpected result from hook_captcha() of module ....".
When you indeed go look on the CAPTCHA settings page, you indeed will see 'default' displayed as fall back for those broken links, but as long as you don't save the settings form, it will not be saved in the database.

Anyway, this behavior might not be the most intuitive, so it might need some fine tuning. IMHO, changing the broken settings automatically is not the correct thing to do, the admin should be informed about it, and given a chance to fix it in the way he prefers (e.g. re-enabling the module again)
For example: when broken settings are detected, we show an error message on the settings page about the issue and inform that just resaving the form would fix it.

chris matthews’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.x-dev
Issue summary: View changes

Version change only

liam morland’s picture

Suggested solution: Before making the "unexpected result" message, check if the $captcha_type_module is enabled. If so, use the current message. Otherwise, use a different message along the lines of, "The module implementing the challenge type is not enabled."