Index: flag.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag/Attic/flag.module,v
retrieving revision 1.11.2.72.2.10
diff -u -r1.11.2.72.2.10 flag.module
--- flag.module	14 Sep 2009 23:59:25 -0000	1.11.2.72.2.10
+++ flag.module	15 Sep 2009 01:27:52 -0000
@@ -721,6 +721,10 @@
 
   // Generate the link URL.
   $link_types = flag_get_link_types();
+  if (!isset($link_types[$flag->link_type])) {
+    // Provide a fallback if the link type no longer exists.
+    $flag->link_type = 'normal';
+  }
   $link_type_module = $link_types[$flag->link_type]['module'];
   $link = module_invoke($link_type_module, 'flag_link', $flag, $action, $content_id);
   if (isset($link['title']) && empty($link['html'])) {
@@ -849,18 +853,6 @@
   return $options;
 }
 
-/**
- * FormAPI process function to add descriptions to radio buttons.
- */
-function flag_expand_option_description($element) {
-  foreach (element_children($element) as $key) {
-    if (isset($element['#option_descriptions'][$key])) {
-      $element[$key]['#description'] = $element['#option_descriptions'][$key];
-    }
-  }
-  return $element;
-}
-
 // ---------------------------------------------------------------------------
 // Non-Views public API
 
Index: includes/flag.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag/includes/Attic/flag.admin.inc,v
retrieving revision 1.1.4.2.2.3
diff -u -r1.1.4.2.2.3 flag.admin.inc
--- includes/flag.admin.inc	14 Sep 2009 20:51:38 -0000	1.1.4.2.2.3
+++ includes/flag.admin.inc	15 Sep 2009 01:27:53 -0000
@@ -307,7 +307,6 @@
     '#title' => t('Roles that may use this flag'),
     '#options' => user_roles(TRUE),
     '#default_value' => $flag->roles,
-    '#required' => TRUE,
     '#description' => t('Checking <em>authenticated user</em> will allow all logged-in users to flag content with this flag. Anonymous users may not flag content.'),
     '#weight' => 5,
     '#access' => empty($flag->locked['roles']),
@@ -347,7 +346,7 @@
     '#title' => t('Link type'),
     '#options' => _flag_link_type_options(),
     '#option_descriptions' => _flag_link_type_descriptions(),
-    '#after_build' => array('flag_expand_option_description'),
+    '#after_build' => array('flag_expand_option_description', 'flag_check_link_types'),
     '#default_value' => $flag->link_type,
     '#weight' => 2,
     '#access' => empty($flag->locked['link_type']),
@@ -431,6 +430,29 @@
 }
 
 /**
+ * FormAPI after_build function to add descriptions to radio buttons.
+ */
+function flag_expand_option_description($element) {
+  foreach (element_children($element) as $key) {
+    if (isset($element['#option_descriptions'][$key])) {
+      $element[$key]['#description'] = $element['#option_descriptions'][$key];
+    }
+  }
+  return $element;
+}
+
+/**
+ * FormAPI after_build function to check that the link type exists.
+ */
+function flag_check_link_types($element) {
+  $link_types = flag_get_link_types();
+  if (!isset($link_types[$element['#value']])) {
+    drupal_set_message(t('This flag uses a link type of %type, which does not exist.', array('%type' => $element['#value'])), 'error');
+  }
+  return $element;
+}
+
+/**
  * Clears various caches when a flag is modified.
  */
 function _flag_clear_cache() {
