drupal-6


How can you safely add a dependency to a Drupal module?


I have a new version of a Drupal 6 module. In the new version, I have added a new dependency in the .info file to a views utility module I've created called lib_views.
However, lib_views may not be enabled when my module is upgraded. If it's not, then upgrading my module causes an irretrievable crash, because views fires a hook that invokes a function in my un-enabled lib_views module.
Is there any safe way to add a new dependency to an existing Drupal module that can prevent this?
You can force drupal to load the module (it's common practice for CCK modules for example).
Example:
function example_install() {
drupal_load('module', 'content');
content_notify('install', 'example');
}
In the example, drupal_load loads the "content" module first, then content_notify is an example of function that can only be used when the content module is available.
So if the drupal_load call returns FALSE, you can detect that the module is missing and notify the user.
Drupal 7 handles this automatically when going to update.php (which you are suppose to visit after updating a module). I suppose another alternative would be to display a warning message via an update function.

Related Links

How do you add Fedex SmartPost as a shipping option?
Group Checkboxes in webform in drupal
Drupal 6 - How can I disable comments on all nodes / content_types?
Webservice creation in Drupal 6.22
Authorize.net returning multiple deliminators
Drupal: What is wrong with my base_path to my libraries folder
creates programmatically a taxonomy in drupal 6
What is the meaning of invoke all function in drupal
Drupal 6 Slideshow with Drupal Views Cycle module
How to remove apple-touch-icon-precomposed.png error
Drupal Combine subdomains into one domain
Drupal 6 - execute code after taxonomy term delete
Delete and modify fields shown in “drupalsite/node/XXX”
Printing a View within a page of html Drupal 6
Can't create Views
Can't access node-taxonomy.tpl.php through page-taxonomy-term.tpl in Drupal 6

Categories

HOME
sendgrid
multithreading
isabelle
reserved
maven-3
icloud
installshield
ojdbc
constraint-programming
portia
communication
metatrader4
ssl-client-authentication
kentor-authservices
u-sql
vb.net-2010
ibm-odm
try-catch
caml
lombok
saxon
jsdoc
connection-string
openedx
immutable.js
swiftlint
abi
sylius
tapestry
mustache.php
kudan
wijmo
trading
kannel
info.plist
uninstall
greendao
tasklet
stormpath
data-manipulation
exuberant-ctags
titanium-mobile
contact-form
framemaker
hybridauth
gammu
environment-modules
html5-fullscreen
picasso
overriding
bower-install
dosbox
neuroscience
libvpx
slick-3.0
angular2-meteor
long-polling
xml-documentation
upstart
fancybox-2
memory-alignment
flutterwave
smart-table
setuptools
rotativa
savon
login-control
skobbler-maps
jwplayer7
sigabrt
ready-api
testng-dataprovider
goose
iad
rtbkit
coveralls
qpainter
tt-news
neolane
dealloc
bundles
hyprlinkr
oracle-warehouse-builder
html5-notifications
pushbackinputstream
seed
ember-app-kit
referrer
dbproviderfactories
gwt-ext
heartbeat
xmemcached
sproutcore-2
mirah
firefox4

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App