hook_requirements('install') doesn't work for contrib

mooffie - September 24, 2008 - 11:01
Project:Drupal
Version:5.x-dev
Component:install system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.]

#1

Damien Tournoud - September 24, 2008 - 11:46
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.

#2

Damien Tournoud - September 24, 2008 - 12:06

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...

AttachmentSizeStatusTest resultOperations
312730-check-requirements-install.patch1 KBIgnoredNoneNone

#3

mooffie - September 24, 2008 - 13:42

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.

#4

maartenvg - September 26, 2008 - 22:57
Status:active» needs review

CNR: to give it the needed extra attention,

#5

earnie@drupal.org - September 27, 2008 - 13:56
Status:needs review» reviewed & tested by the community

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

#6

drumm - October 5, 2008 - 01:47
Status:reviewed & tested by the community» fixed

Committed to 5.x.

#7

drewish - October 8, 2008 - 20:46

#8

Anonymous (not verified) - October 22, 2008 - 20:54
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.