Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.54
diff -u -p -r1.54 mollom.module
--- mollom.module	24 Jul 2010 00:51:57 -0000	1.54
+++ mollom.module	29 Jul 2010 17:18:21 -0000
@@ -1580,16 +1580,24 @@ function mollom_get_statistics($refresh 
 /**
  * Implements hook_field_extra_fields().
  *
- * Allow users to re-order the CAPTCHA field on node forms through the Field UI.
+ * Allow users to re-order Mollom form additions through Field UI.
  */
-function mollom_field_extra_fields() {
+function mollom_field_extra_fields($entity_type, $bundle, $context) {
   $extras = array();
-  foreach (node_type_get_names() as $type => $name) {
-    if (mollom_form_load($type . '_node_form')) {
-      $extras['node'][$type]['mollom'] = array(
+  if ($context == 'form') {
+    // Since we ain't know anything about the entity's form here, we have to
+    // second guess here. :-|
+    $form_ids = array(
+      "{$entity_type}_form",
+      "{$bundle}_{$entity_type}_form",
+      "{$entity_type}_{$bundle}_form",
+      "{$entity_type}_form_{$bundle}",
+    );
+    if (db_query('SELECT 1 FROM {mollom_form} WHERE form_id IN (:ids)', array(':ids' => $form_ids))->fetchField()) {
+      $extras[$entity_type][$bundle]['mollom'] = array(
         'label' => t('Mollom'),
         'description' => t('Mollom CAPTCHA'),
-        'weight' => 99999,
+        'weight' => 99,
       );
     }
   }
