Index: imagefield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.module,v
retrieving revision 1.110
diff -u -r1.110 imagefield.module
--- imagefield.module	29 Jun 2010 19:27:05 -0000	1.110
+++ imagefield.module	29 Jun 2010 22:27:26 -0000
@@ -10,20 +10,6 @@
 require_once dirname(__FILE__) . '/imagefield_widget.inc';
 
 /**
- * Implementation of hook_init().
- *
- * Load required includes.
- */
-function imagefield_init() {
-  // If FileField is not available, immediately disable ImageField.
-  if (!module_exists('filefield')) {
-    module_disable(array('imagefield'));
-    drupal_set_message(t('The ImageField module has been disabled. The <a href="http://drupal.org/project/filefield">FileField module</a> needs to be installed for it to work properly.'));
-    return;
-  }
-}
-
-/**
  * Implementation of hook_theme().
  */
 function imagefield_theme() {
@@ -79,6 +65,11 @@
 function imagefield_elements() {
   $elements = array();
 
+  // Catch problems when this is called too early during installation or update.
+  if (!module_exists('filefield')) {
+    return $elements;
+  }
+
   // An ImageField is really just a FileField with extra processing.
   $filefield_elements = module_invoke('filefield', 'elements');
   $elements['imagefield_widget'] = $filefield_elements['filefield_widget'];
