We need to document the fact that hook_requirements('install') doesn't work for modules that don't reside in the main './modules' folder. In other words, that this hook works only for core modules. And since new core modules aren't written for Drupal 5 anymore, it's best to simply remove any mention of hook_requirements('install') from the documentation.

The reason hook_requirements('install') only work for modules residing in './modules' is because the module is loaded via drupal_get_install_files(), which does file_scan_directory('./modules', ...).

[The problem is specific to Drupal 5. It doens't exist in Drupal 6.]

Comments

damien tournoud’s picture

Title: Explain that hook_requirements('install') doesn't work for contrib » hook_requirements('install') doesn't work for contrib
Component: documentation » install system

That's a plain bug, not just a documentation bug.

damien tournoud’s picture

Here is a patch for this.

Note: the require_once(common.inc) is absolutely required. It only works without this on D6 because _drupal_maintenance_theme loads it itself...

mooffie’s picture

I can confirm that the patch works.

Damien, thanks.

I admit that the thought "we should fix this" has never crossed my mind. I imagined months upon months of deliberations. You are very optimistic, Damien.

maartenvg’s picture

Status: Active » Needs review

CNR: to give it the needed extra attention,

earnie@drupal.org’s picture

Status: Needs review » Reviewed & tested by the community

Since @moofie confirms that the patch works let's say so.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

drewish’s picture

Status: Fixed » Closed (fixed)

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