Every time the Administer >> Site building >> SimpleTest form is ran, it does this bizarre workaround to check if the SimpleTest library is installed or not. I presume this code pre-dates hook_requirements(), which will run only on installation, and/or when you hit admin/reports/status. Let's clean this sucker up.

Comments

webchick’s picture

Status: Active » Needs review
FileSize
5.15 KB

I don't imagine this is perfect yet, but I want to roll a patch for the drupalPost change and to do so I have to blow away what I'm working on. ;)

Rok Žlender’s picture

This is a very clean way of checking for simpletest lib. But the problem is requirements check does not happen on module enable and so user can click on simpletest link in menu and is presented with a php errror or even WSOD if errors are not shown. This is obviously not cool. I like your idea very much and would like to see it happen so if there is some way other way. Can we check for error in simpletest requirements before we present simpletest form?

webchick’s picture

Status: Needs review » Needs work

Right. This is not functionally equivalent. I was thinking this would prevent the module from being installed at all, but I don't think it does.

I'll do some pondering about this a bit more...

moshe weitzman’s picture

This should prevent it from being installed in D6. D5 had a bug whereby 'install' phase requirements were not checked (i thought this was fixed). hook_requirements() definately has a $phase='install' which stops the install if there is a REQUIREMENTS_ERROR raised.

boombatower’s picture

Version: 6.x-1.x-dev »

This looks like something that would work.

Is this still something we want to do?

If so can someone take the initiative and write it.

webchick’s picture

Oh, I ran into this today on another module, and it turns out hook_requirements() has to be in an .install file, not the .module file. It might be that if this is re-rolled with the function in simpletest.install instead it could work.

webchick’s picture

Version: » 6.x-1.x-dev
Assigned: Unassigned » webchick

I'm moving back to 6.x, since 7.x (Drupal core) includes SimpleTest so this dependency will never be missing. Also, I'm assigning to myself, since that code utterly offends me on a basic level. :P

webchick’s picture

Status: Needs work » Needs review
FileSize
5.65 KB

Re-roll. Seems to work this time. :)

boombatower’s picture

Status: Needs review » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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