? .svn
? 877064-2-teaser-length.patch
? alpha2alpha/.cvsignore
Index: head2head.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/head2head/head2head.module,v
retrieving revision 1.35
diff -u -p -r1.35 head2head.module
--- head2head.module	8 Sep 2010 18:16:10 -0000	1.35
+++ head2head.module	8 Sep 2010 23:14:21 -0000
@@ -491,3 +491,26 @@ function head2head_895032() {
     system_update_7059();
   }
 }
+
+/**
+ * Set the 'trim_length' formatter setting for existing fields.
+ */
+function head2head_504564() {
+  $instances = field_info_instances();
+  // It was previously possible to set the teaser length for a node type, but
+  // not for any other entity type. So we only check node instances.
+  foreach ($instances['node'] as $node_type => $bundle) {
+    foreach ($bundle as $field_name => $instance) {
+      foreach ($instance['display'] as $view_mode => $settings) {
+        // Fields that used the text_trimmed or text_summary_or_trimmed
+        // formatters were picking up the teaser_length_{node_type} setting.
+        if ($settings['type'] == 'text_trimmed' || $settings['type'] == 'text_summary_or_trimmed' && !isset($settings['settings']['trim_length'])) {
+          $instance['display'][$view_mode]['settings']['trim_length'] = variable_get('teaser_length_' . $node_type, 600);
+        }
+      }
+      field_update_instance($instance);
+    }
+    // The teaser_length_{node_type} variable is no longer used.
+    variable_del('teaser_length_' . $node_type);
+  }
+}
Index: alpha2alpha/alpha2alpha.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/head2head/alpha2alpha/alpha2alpha.install,v
retrieving revision 1.21
diff -u -p -r1.21 alpha2alpha.install
--- alpha2alpha/alpha2alpha.install	8 Sep 2010 18:33:21 -0000	1.21
+++ alpha2alpha/alpha2alpha.install	8 Sep 2010 23:14:21 -0000
@@ -242,6 +242,13 @@ function alpha2alpha_update_7704() {
 }
 
 /**
+ * Set the 'trim_length' formatter setting for existing fields.
+ */
+function alpha2alpha_update_7705() {
+  alpha2alpha_update_helper('504564', 7);
+}
+
+/**
  * @} End of "defgroup updates-alpha-6-to-7"
  * The next series of updates should start at 7800.
  */
