Index: modules/block/block.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.install,v
retrieving revision 1.40
diff -u -p -r1.40 block.install
--- modules/block/block.install	28 Mar 2010 11:16:29 -0000	1.40
+++ modules/block/block.install	9 May 2010 22:59:00 -0000
@@ -387,3 +387,16 @@ function block_update_7004() {
   // Rebuild theme data, so the new 'help' region is identified.
   system_rebuild_theme_data();
 }
+
+/**
+ * Update custom blocks to store an explicit text format ID.
+ */
+function block_update_7005() {
+  // Find any custom blocks that have "0" (the old FILTER_FORMAT_DEFAULT
+  // constant) as their stored text format, and as per filter_update_7005(),
+  // update them to use the current default text format instead.
+  db_update('block_custom')
+    ->fields(array('format' => variable_get('filter_default_format', 1)))
+    ->condition('format', 0)
+    ->execute();
+}
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.66
diff -u -p -r1.66 comment.install
--- modules/comment/comment.install	17 Apr 2010 12:54:02 -0000	1.66
+++ modules/comment/comment.install	9 May 2010 22:59:00 -0000
@@ -327,9 +327,8 @@ function comment_update_7013(&$sandbox) 
     db_insert($comment_body_table)
       ->from($query)
       ->execute();
-    // Update the comment body format in a similar manner as is done for other
-    // modules in filter_update_7005(), but we do this one here since we are
-    // already migrating the data.
+    // Explicitly store the current default text format if the comment body did
+    // not have its own text format, as per filter_update_7005().
     db_update($comment_body_table)
       ->fields(array('comment_body_format' => variable_get('filter_default_format', 1)))
       ->condition('comment_body_format', 0)
Index: modules/filter/filter.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.install,v
retrieving revision 1.37
diff -u -p -r1.37 filter.install
--- modules/filter/filter.install	1 May 2010 08:12:23 -0000	1.37
+++ modules/filter/filter.install	9 May 2010 22:59:00 -0000
@@ -140,19 +140,6 @@ function filter_install() {
 }
 
 /**
- * Implements hook_update_dependencies().
- */
-function filter_update_dependencies() {
-  // Filter update 7005 migrates block data and therefore needs to run after
-  // the {block_custom} table is properly set up.
-  $dependencies['filter'][7005] = array(
-    'taxonomy' => 7002,
-  );
-
-  return $dependencies;
-}
-
-/**
  * @defgroup updates-6.x-to-7.x Filter updates from 6.x to 7.x
  * @{
  */
@@ -315,9 +302,19 @@ function filter_update_7004() {
  * Integrate text formats with the user permissions system.
  *
  * This function converts text format role assignments to use the new text
- * format permissions introduced in Drupal 7, creates a fallback (plain text)
- * format that is available to all users, and explicitly sets the text format
- * in cases that used to rely on a single site-wide default.
+ * format permissions introduced in Drupal 7 and creates a fallback (plain
+ * text) format that is available to all users.
+ *
+ * As a result of this update, the site-wide default text format from Drupal 6
+ * no longer exists, and modules which previously stored "0" in database tables
+ * to indicate that a particular piece of text should be filtered using the
+ * default text format need to be updated to explictly store the actual text
+ * format ID instead. For example, the core Block, Comment and Node modules all
+ * contain separate updates to handle this situation.
+ *
+ * @see block_update_7005()
+ * @see comment_update_7013()
+ * @see node_update_7006()
  */
 function filter_update_7005() {
 
@@ -379,24 +376,11 @@ function filter_update_7005() {
     ->condition('format', $default_format)
     ->execute();
 
-  // It was previously possible for a value of "0" to be stored in database
-  // tables to indicate that a particular piece of text should be filtered
-  // using the default text format. Therefore, we have to convert all such
-  // instances (in Drupal core) to explicitly use the appropriate format.
-  // Note that the update of the node body field is handled separately, in
-  // node_update_7006(), as is the update of the comment body field, in
-  // comment_update_7013().
-  foreach (array('block_custom') as $table) {
-    if (db_table_exists($table)) {
-      db_update($table)
-        ->fields(array('format' => $default_format))
-        ->condition('format', 0)
-        ->execute();
-    }
-  }
-
   // We do not delete the 'filter_default_format' variable, since other modules
-  // may need it in their update functions.
+  // need it in their update functions (for the case where a value of "0" was
+  // stored in the database but now needs to be replaced with the actual text
+  // format ID). See block_update_7005(), comment_update_7013(), and
+  // node_update_7006() for examples of how this is used.
   // @todo This variable can be deleted in Drupal 8.
 }
 
Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.50
diff -u -p -r1.50 node.install
--- modules/node/node.install	5 May 2010 15:11:51 -0000	1.50
+++ modules/node/node.install	9 May 2010 22:59:00 -0000
@@ -566,9 +566,7 @@ function node_update_7006(&$sandbox) {
           }
           $node->body[$langcode][0]['value'] = $revision->body;
           // Explicitly store the current default text format if the revision
-          // did not have its own text format. Similar conversions for other
-          // core modules are performed in filter_update_7005(), but we do this
-          // one here since we are already migrating the data.
+          // did not have its own text format, as per filter_update_7005().
           $node->body[$langcode][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1);
           // This is a core update and no contrib modules are enabled yet, so
           // we can assume default field storage for a faster update.
