Index: active_translation.batch.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/active_translation/active_translation.batch.inc,v
retrieving revision 1.4
diff -u -p -r1.4 active_translation.batch.inc
--- active_translation.batch.inc	1 Jun 2008 19:29:47 -0000	1.4
+++ active_translation.batch.inc	16 Jun 2008 22:47:29 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: active_translation.batch.inc,v 1.4 2008/06/01 19:29:47 drewish Exp $
+// $Id: active_translation.batch.inc,v 1.5 2008/06/16 20:25:32 drewish Exp $
 
 /**
  * Build a batch to rebuild all the translation information.
@@ -19,7 +19,7 @@ function active_translation_build_batch_
 
 function _active_translation_batch_operation(&$context) {
   if (empty($context['sandbox'])) {
-    watchdog('active_translation', 'Rebuilding the active translation table.');
+    watchdog('active_translation', 'Starting to rebuild the active translation table.');
 
     // Initiate multistep processing. Call language_list() and reset its cache.
     $context['sandbox']['languages'] = array_keys(language_list('language', TRUE));
@@ -41,7 +41,13 @@ function _active_translation_batch_opera
       $fields[] = db_escape_table($lang_code);
       $values[] = 'nid';
     }
-    db_query('INSERT INTO {active_translation} (atid, '. implode(', ', $fields) .') SELECT DISTINCT(nid), '. implode(', ', $values) .' FROM {node} WHERE tnid = 0 ORDER BY tnid');
+    // We can't use db_placeholders() because we're using field names rather
+    // than values.
+    $sql = 'INSERT INTO {active_translation} (atid, '. implode(', ', $fields) .') SELECT DISTINCT(nid), '. implode(', ', $values) .' FROM {node} WHERE tnid = 0 ORDER BY tnid';
+    watchdog('active_translation', 'Running query: @sql', array('@sql' => $sql), WATCHDOG_DEBUG);
+    db_query($sql);
+
+    watchdog('active_translation', 'Created records for untranslated and language neutral nodes.');
   }
 
   // Process the next set of translations.
@@ -63,10 +69,11 @@ function _active_translation_batch_opera
 
 function _active_translation_batch_finished($success, $results, $operations) {
   if ($success) {
+    watchdog('active_translation', 'Sucessfully rebuilt the active translation table.');
     drupal_set_message(t('The active translation table has rebuilt.'));
-    node_access_needs_rebuild(FALSE);
   }
   else {
+    watchdog('active_translation', 'There was an error that prevented the active translation table from being properly rebuilt.', array(), WATCHDOG_ERROR);
     drupal_set_message(t('The active translation table has not been properly rebuilt.'), 'error');
   }
   cache_clear_all();
Index: active_translation.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/active_translation/active_translation.install,v
retrieving revision 1.6
diff -u -p -r1.6 active_translation.install
--- active_translation.install	15 Jun 2008 19:49:30 -0000	1.6
+++ active_translation.install	16 Jun 2008 22:47:29 -0000
@@ -5,8 +5,7 @@
  * Implementation of hook_install().
  */
 function active_translation_install() {
-  // We don't do any schema installation here, it happens in
-  // _active_translation_batch_operation().
+  // The schema installation happens in active_translation_enable().
 }
 
 /**
@@ -20,6 +19,8 @@ function active_translation_uninstall() 
  * Implementation of hook_enable().
  */
 function active_translation_enable() {
+  drupal_install_schema('active_translation');
+
   require_once drupal_get_path('module', 'active_translation') .'/active_translation.batch.inc';
   batch_set(active_translation_build_batch_all());
 }
