[development] Distributing "bi-modal" Drupal modules

Rob Thorne rob at torenware.com
Wed Feb 17 07:26:31 UTC 2010


A bit of clarification:
> 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 
> version.
The problem here is that just as the Drupal project won't bundle certain 
things due to licensing issues, some other projects can't (or won't) put 
themselves under the Drupal repository.

The CiviCRM project is an example.  It uses an Affero license, and it  
can  be deployed under Joomla, as a  standalone, or under Drupal.  For 
other projects, it can be difficult to link themselves to the hip of the 
Drupal release schedule.  Their user base likely will lag in D7 
adoption, for mostly sociological reasons (they server a lot of small 
non-profits).  But there are definitely users that need and want to use 
D7 for other reasons.  The CiviCRM project, while it has a growing 
community, is much smaller than the Drupal community, and it's difficult 
for them to support multiple Drupal versions.

I don't speak for the CiviCRM people; I'm just a developer that does a 
good deal with their platform.  But I'm aware this is an issue for 
them.   Very reasonably, I think.

I'm hoping that it's possible to put two .info files referring to 
different module names, each .info referring to a different Core 
version.  If by "reject" you mean ignore (rather than, say, go ape s***, 
white screen or otherwise misbehave, this is excellent, since both 
modules can be packaged with the larger project, and Drupal will just 
choose the "right" module.

> 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