Same idea as https://www.drupal.org/node/2465073 for the Captcha module, when Honeypot needs to disable the page cache for the current page, it would be better to call:

drupal_page_is_cacheable(FALSE);

...rather than the way it's currently done by modifying the $conf global:

$GLOBALS['conf']['cache'] = 0;

Apart from anything else, this makes it much easier to work out what's mysteriously disabling page cache on a site.

Patch on the way.

Comments

mcdruid created an issue. See original summary.

mcdruid’s picture

mcdruid’s picture

Issue summary: View changes
geerlingguy’s picture

Status: Active » Needs review

Two thumbs up! I'll merge this fix soon. I'll let the testbot have a go first, of course.

geerlingguy’s picture

I'll also need to do this for D8, using \Drupal::service('page_cache_kill_switch')->trigger();; see https://www.drupal.org/node/2323571

  • geerlingguy committed 273b01e on 7.x-1.x authored by mcdruid
    Issue #2553319 by mcdruid: disable page cache through the API rather...
geerlingguy’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs review » Patch (to be ported)

Needs to next be ported to D8.

geerlingguy’s picture

Status: Patch (to be ported) » Fixed

The D8 work was already done by @justAChris over in #2556233: Disable caching correctly on all forms. Nice! This can be marked as fixed, and I'll backport the new form cache test in the other ticket.

Status: Fixed » Closed (fixed)

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