I'm getting the following error intermittently showing up in my logs. I think this module might be doing some operations before includes/unicode.inc is loaded, (for example, in hook_init() or hook_boot()) and not properly checking for the availability of core functions.
Call to undefined function drupal_strtolower() in drupal/sites/all/modules/contrib/acquia_purge/acquia_purge.module on line 794
Note: I was also seeing a lot of PHP errors about calls to drupal_get_path_alias() from url(), but I have applied this patch to mitigate those issues and I am not sure they are caused by this module, but I suspect they may be related.
I'm filing this issue as major as these PHP fatals are causing site downtime. I haven't found a solution yet but will continue to work on it. Posting here in case anyone else is having the same problem and/or working on a fix!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | acquia_purge-prevent_undefined_drupal_strtolower-2966566-3.patch | 639 bytes | jenlampton |
Comments
Comment #2
jenlamptonComment #3
jenlamptonI'm attaching a patch here for the 7.x-1.3 version of the module. The patch did not apply cleanly to the 1.x-dev branch so it will likely need some reworking to fix the problem there, should it still exist.
I'm not sure what benefit using
drupal_strtolower()provided in this instance, but I've switched it out with PHP'sstrtolower()in the instances when Drupal isn't fully bootstrapped (or includes/unicode.inc isn't properly loaded.)I've done some more investigating and it looks like the PHP fatal on purging only happens when
$conf['acquia_purge_lateruntime'] = TRUE; is set in settings.php, and even then, only some of the time. (so I'm downgrading this from Critical to Major). I have several sites running acquia_purge without that setting, and those have never had any problems using drupal core functions while purging.Registering a
_drupal_shutdown_functionto do the purge is probably not a wise choice here. Drupal is not (always) fully bootstrapped at this runtime phase, so you need to be sure not to call any core functions without explicitly requiring the files they're defined in.Comment #4
jenlamptonComment #7
japerryIt looks like some other functions within common.inc load unicode.inc if it hasn't loaded yet. Because
drupal_strtolowerdoesn't reference any other functions/methods other than php, this looks safe to do. Pushed to head, so you'll need to upgrade to 7.x-1.4 when its out.