When running the test:

sites/default/files/simpletest/verbose/StateRulesViewsTestCase-44.html

Fatal error: Call to undefined function drupal_map_assoc() in /path/to/rules/includes/rules.core.inc on line 989

Not sure why this happens, and there are no other reports about this as of this writing.

Comments

alberto56’s picture

StatusFileSize
new39.24 KB

Here is the print_r of the backtrace of this.

alberto56’s picture

Hmmm doing the exact same thing outside of simpletest works fine. Something to do with simpletest's bootstrap? No, still nothing on Google :(

alberto56’s picture

Priority: Normal » Major

Ha! Adding this:

    if (!function_exists('drupal_map_assoc')) {
      require_once DRUPAL_ROOT . '/includes/common.inc';
    }

at line 989 of path/to/modules/rules/includes/rules.core.inc
and *all* the tests pass!
Boosting to major, and this is therefore linked to #1376604: Test "Mail has been sent if a comment is present and more than a day has passed since the last processing." failing

alberto56’s picture

Why did at least one of the previous calls to cron work, then?

alberto56’s picture

Sending a mail just before running cron touches this off. Weird.

alberto56’s picture

This is actually not a bug with this module, but rather has to do with the fact that Drupal does not include common.inc before serializing some variables during caching. More info here:

- #1386424: Do not assume that common.inc has been loaded during __sleep()
- #1376688: Load common.inc before serializing a variable (during caching), as objects may trigger code in __sleep() while being serialized

alberto56’s picture

Title: Fatal error Call to undefined function drupal_map_assoc in rules.core.inc when simpletest calls cron, sometimes. » Remove part of the test that fails because of #1376688 and/or #1386424
Category: bug » task
Priority: Major » Normal
Status: Active » Postponed
StatusFileSize
new1.3 KB

I have submitted patches for review for both the issues referenced in comment 7, and if either patch gets in, all our tests will pass. However, until such a time, I have removed the part of the test that fails because of these issues and committed the change to MASTER. I will leave this issue open until one or the other or both of those issues are resolved and I can completely test this module.
The enclosed patch should be reapplied once one or the other of the two issues in comment 7 are fixed.

alberto56’s picture

Title: Remove part of the test that fails because of #1376688 and/or #1386424 » More complete test coverage once #1376688 and/or #1386424 are fixed
alberto56’s picture

StatusFileSize
new1.01 KB

This is the patch which should be applied, rather than the one at comment 8.

alberto56’s picture

Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

added google link