Module Spotlight: CiviCRM 2.0 Compatibility
on
December 17, 2008
Module Spotlight: CiviCRM 2.0 Compatibility
When upgrading your CiviCRM site from 1.x to 2.x you might have to upgrade some custom modules. If you're upgrading to CiviCRM 2.1 or higher, this also requires that you're running Drupal 6. Upgrading your custom Drupal 5 modules for Drupal 6 is pretty easy: you simply download the coder module which will point out almost all required changes to your module with direct links to the documentation page about converting 5.x modules to 6.x.
Upgrading your custom CiviCRM modules to be compatible with 2.x however won't be as easy since a bunch of functions have been replaced or removed. The idea is to motivate developers to use the internal API's directly and not use these helper functions anymore. There is a developer discussion about the API Migration from 1.x to 2.x and while it offers some indication as to what functions were replaced, it doesn't provide a valid alternative for all removed functions.
CiviCRM's Donald Lobo describes the issue as such:
Lack of documentation makes switching from the helper functions to the BAO objects a daunting task, especially if you're looking at a tight deadline or a client budget limit and you can't spend too much time on the upgrade. If this is the case you can resort to the CiviCRM 2.0 Compatibility module which re-creates these helper functions. This means that most functionality of your CiviCRM 1.x module will keep working so you can upgrade the module in due time. Be sure to read the documentation on the project page to implement the functionality. Also note that this module is intended to work as a temporary solution and that you are advised to eventually upgrade to the CiviCRM 2.x BAO objects in order to preserve your upgrade path.We use the BAO objects directly and did not exercise the API. This led to the API not being maintained / upgraded, and as such was not tested very well. In general I'm more inclined to get folks to call the internal API's directly, and we should do a better job documenting / unit testing those components rather than maintaining two pieces of code.












