--- modules/menu/menu.admin.inc	2010-10-20 09:40:59.000000000 +0200
+++ modules/menu/menu.admin.inc	2010-10-29 14:39:47.048000000 +0200
@@ -385,6 +385,19 @@ function menu_edit_item_validate($form, 
   if (!trim($item['link_path']) || !drupal_valid_path($item['link_path'], TRUE)) {
     form_set_error('link_path', t("The path '@link_path' is either invalid or you do not have access to it.", array('@link_path' => $item['link_path'])));
   }
+  elseif (preg_match('/^node\/(\d+)/', trim($item['link_path']), $matches)) {
+    $type = db_query("SELECT type FROM {node} WHERE nid = :nid", array(':nid' => $matches[1]))->fetchField();
+    if ($type) {
+      $type_menus = variable_get('menu_options_'. $type, array('main-menu' => 'main-menu'));
+      list($menu_name, $plid) = explode(':', $item['parent']);
+      if (!in_array($menu_name, $type_menus)) {
+        form_set_error('parent', t("The %menu_title menu cannot contain links to the path '@link_path'.", array(
+          '%menu_title' => substr($form['parent']['#options'][$menu_name .':0'], 1, -1),
+          '@link_path' => $item['link_path'],
+        )));
+      }
+    }
+  }
 }
 
 /**
--- modules/menu/menu.test	2010-11-02 17:06:56.890625000 +0100
+++ modules/menu/menu.test	2010-11-02 16:53:17.437500000 +0100
@@ -25,6 +25,8 @@ class MenuTestCase extends DrupalWebTest
     // Create users.
     $this->big_user = $this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content'));
     $this->std_user = $this->drupalCreateUser(array());
+    // Alter node type menu settings.
+    variable_set("menu_options_article", array('main-menu', 'navigation'));
   }
 
   /**
@@ -170,6 +172,9 @@ class MenuTestCase extends DrupalWebTest
     $this->assertResponse(200);
     $this->assertText(t('The block settings have been updated.'), t('Custom menu block was enabled'));
 
+    // Make this menu available for the article type.
+    variable_set("menu_options_article", array('main-menu', 'navigation', $menu_name));
+
     return menu_load($menu_name);
   }
 
