I'm writing this for more compatibility with the Bad Behavior Drupal module and associated Bad Behavior PHP Spam Filter. I've been speaking to the maintainers of the (non-Drupal) Bad-Behavior scripts, because I've been getting a lot of "errors" listed by Boost in the Page Cache Status Block. I've fixed a few in the Bad Behavior Drupal module which were causing some, but here is another I'm now getting listed in the Boost Page Cache Block on a great many of my nodes:

There are php errors or drupal messages on this page, preventing boost from caching. ERROR:

Array

[type] => 8
[message] => Undefined offset:  1
[file] => /sites/all/modules/badbehavior/bad-behavior/functions.inc.php
[line] => 47

And here is what the Bad Behavior people say about it:

It looks like you have error_reporting set to E_ALL and thus PHP notices are being reported. For whatever reason Boost seems to be catching them. You said before that you didn't have display_errors set, but perhaps Boost has set it for you? Worse, it seems the notices are being reported even when the utterly harmless ones are being suppressed with @. So I don't know. I would suggest you double check your PHP configuration again, and maybe get the Boost maintainer in on this.

I do have PHP error reporting to display off, but to log them. Does Boost reverse that somehow?

If we had more granular control over what level of PHP error was making Boost not cache nodes, we could control this kind of thing ourselves I would think. Any help would be appreciated. Please let me know if you have questions.

CommentFileSizeAuthor
#3 boost-621054.patch4.24 KBmikeytown2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Uncheck "Do not cache if PHP error on page. " on Boost advanced settings and problem should go away.

gregarios’s picture

Uncheck "Do not cache if PHP error on page. " on Boost advanced settings and problem should go away.

Yes, I'm aware of that solution. I don't want it caching 'bad' PHP errors though. I'd like it to ignore some, but not all. Currently, the setting only allows you to ignore all errors or none. It would be nice to have another option, like maybe having a button in the block to 'ignore this error' or such.

Or, maybe a global setting that would allow you to ignore any errors containing a certain string — that would be awesome.

mikeytown2’s picture

Status: Active » Needs review
FileSize
4.24 KB

Error code of 8 is E_NOTICE, That should have been ignored to begin with. Now it is. As for your feature request, thats too much of a pain to do. I will accept a patch but I'm not going to code it up.

mikeytown2’s picture

Category: feature » bug
mikeytown2’s picture

Title: Granular PHP Error "do not cache" level, for more module compatibility » PHP Error thrown on E_NOTICE
mikeytown2’s picture

Status: Needs review » Fixed

committed

gregarios’s picture

Thanks! Will this be in the 1.14 version soon then?

mikeytown2’s picture

Status: Fixed » Closed (fixed)

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