The module needs to make the pages not cacheable when displaying captcha elements. This is done in captcha_element_process() using:

global $conf;
$conf['cache'] = FALSE;

This is not the correct way to do this. It will disable caching for everything. That's not the purpose.

So it needs to be replaced by:

drupal_page_is_cacheable(FALSE);
CommentFileSizeAuthor
#1 captcha-page-not-cacheable-2465073-1.patch625 bytesmfernea

Comments

mfernea’s picture

StatusFileSize
new625 bytes

Here is the patch.

mfernea’s picture

Status: Active » Needs review
mcdruid’s picture

+1

I spent a while today trying to work out what was disabling page cache on a site, and it's much easier to do so when modules use API functions like drupal_page_is_cacheable rather than overriding the global $conf.

mcdruid’s picture

Status: Needs review » Reviewed & tested by the community

Tested this patch on a vanilla D7 install and it works as intended.

geerlingguy’s picture

On a separate note, the D8 version of the module already seems to be using the proper API usage for disabling the cache, so this patch will not need to be forward-ported.

wundo’s picture

wundo’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks! :)

  • wundo committed 64f0caa on 7.x-1.x authored by mfernea
    Issue #2465073 by mfernea, mcdruid: Be nice to configuration when making...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.