[development] Distributing "bi-modal" Drupal modules

larry at garfieldtech.com larry at garfieldtech.com
Tue Feb 16 19:40:02 UTC 2010

I certainly hope they don't do it a lot.  As of Drupal 6, info files 
must specify their core version and will be rejected by any other core 

If you have code that doesn't change between two versions, sure, you can 
put it into an include file of your own.  And then look into a good 
source code management system.  (Where good = not CVS.  It looks like 
Drupal.org has finally started the process of moving toward git, which 
should make such code management substantially easier.)

Really, this is exactly where good branch and merge management is your 
friend.  There's no reason at all to ship "dud" D6 code with a D7 module 
or "dud" D7 code with a D6 module.

--Larry Garfield

Aaron Winborn wrote:
> If folks start doing a lot of that, might be nice to add support for an 
> 'ignore-if-not-supported' property or something to the .info file so it 
> doesn't show up w/ a warning in the other version.
> Brian Vuyk wrote:
>> That is, you could probably release a folder structure / package along 
>> the lines of:
>> mymodule/
>>  includes/shared.inc
>>  mymodule_d6.module
>>  mymodule_d6.info
>>  mymodule_d7.module
>>  mymodule_d7.info
>> Where 'includes/shared.inc' would include logic shared between the two 
>> different modules. Both modules would show up on the 'Modules' page, 
>> but only the one corresponding to the correct version of Drupal could 
>> be enabled.

More information about the development mailing list