I don't know if this causes problems in Drupal 7, but with simpletest on Drupal 6, if module_exists() is called during set-up, the result is wrong because the static variable is not refreshed until after the modules are installed.

Comments

darren oh’s picture

Patch for Drupal 6 at http://drupal.org/node/440836.

cburschka’s picture

Title: Error when installation uses module_exists() » Reset module_list() and module_implements() on test setup.

Seems to be in order for now, but be aware that module.inc is going to be converted to the static caching API, and these calls may then have to be replaced with drupal_static_reset('module_list') etc. Depending on whether the $reset parameter is removed from these, which is still debated.

The issue to follow is #422370: Revisit and convert mail.inc, module.inc, pager.inc to use static caching API.

Status: Needs review » Needs work

The last submitted patch failed testing.

dave reid’s picture

This patch fixes the errors a lot of us are seeing in D6 and D7 with exceptions with tables not found (cache_update, etc).

boombatower’s picture

Status: Needs work » Needs review
StatusFileSize
new908 bytes

Re-roll.

darren oh’s picture

The root problem is that the module list from the previous test is being used during the setup the next test. This patch actually fixes the problem, rather than working around it.

P.S. I now see that the other issue fixes the install system rather than the testing system, so it's not a workaround. My main concern was to make the testing system work the same way as enabling modules on the module administration page. That patch would do that.

darren oh’s picture

Status: Needs review » Closed (duplicate)

Since the other patch appears to have a good chance of being committed, I'm setting the status of this issue to duplicate.

boombatower’s picture

This patch does not fix both problems, but the other patch does so lets stick with that one.

kenorb’s picture

Duplicate of what?
I'm lost.