[development] creating forward compatable modules?

Syscrusher scott at 4th.com
Wed Nov 23 23:30:09 UTC 2005

On Wednesday 23 November 2005 15:11, Tao Starbow wrote:
> I was 
> wondering if it is possible to create modules that will be compatible 
> with both 4.6 and 4.7?

This particular upgrade happens to have the new forms API, which is a clean
break with previous form-handling architecture, so although it's *possible* to
to this, with a lot of checking for functions existing or not, it's generally
not *practical* to do so. Easier to just create a clean copy of the module
then optimize for 4.7+.

In the past, though, multi-version modules haven't been too hard, at least
within a close range of versions. I have several contributed modules that
used the same code base for 4.5 and 4.6, with just a little conditional logic.
Of course, no one can say what will be the situation between 4.7 and 4.8. :-)

Drupal's philosophy seems to be one of treating database schemas and logic flow
patterns as "semi-solid" and the code itself as being largely "fluid". I think
that's one of the things I like about Drupal, because although it means some
recode work with each version, it also tends to keep out the cruft. If you have
application-specific functions that are independent of Drupal itself, you can
easily separate them into an "include" file that is shared across multiple
versions of your module.

Hope this helps.


Scott Courtney     Drupal user name: "syscrusher"   http://drupal.org/user/9184
scott at 4th dot com       Drupal projects: http://drupal.org/project/user/9184
Sandbox:  http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/syscrusher

More information about the development mailing list