While calling drupal_get_messages, for example, drupal_get_messages('error'), intend to clear the error messages, then the $_SESSION['messages'] becomes an empty array. Thus, _authcache_is_cacheable function will always return FALSE because isset($_SESSION['messages']) is TRUE, in authcache.helper.inc line 59.

Attached is a patch file which checks also if $_SESSION['messages'] is not empty before returning cacheable as FALSE.

CommentFileSizeAuthor
authcache.helpers.inc_.patch521 bytesbalawang
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

znerol’s picture

In Authcache 7.x-2.x we use this code fragment:

if (drupal_set_message()) {
  // Disable authcache here...
}

Do you think that this approach would also work in Authcache 7.x-1.x?

balawang’s picture

@znerol, this code fragment also works, it's simpler and clean. I will go with your solution.

Cheers,
Bala

  • znerol committed bc6b057 on 7.x-1.x authored by balawang
    Issue #2276131 by balawang: Call drupal_get_message will cause page not...
znerol’s picture

Status: Patch (to be ported) » Fixed

Thank you for reporting the issue. A modified version of the patch has been committed and is now part of the 7.x-1.x-dev version.

Status: Fixed » Closed (fixed)

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