Drupal 6: New-forum-topic links fix

New forum topic links (i.e. node/add/forum/0) result in page not found.

There seems to missing a menu entry to handle the forum id. This patch in the node module hook_menu() adds such item and fixes the problem.

diff --git a/modules/node/node.module b/modules/node/node.module
index 4cc6bdf..1b94672 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1535,6 +1535,17 @@ function node_menu() {
       'type' => MENU_CALLBACK,
     );
   }
+  // patch for forum links
+  $items['node/add/forum/%'] = array(
+    'title' => drupal_ucfirst(t("Forum topic")),
+    'title callback' => 'check_plain',
+    'page callback' => 'node_add',
+    'page arguments' => array(2),
+    'access callback' => 'node_access',
+    'access arguments' => array('create', 'forum'),
+    'description' => "forum topic",
+    'file' => 'node.pages.inc',
+  );
   $items['node/%node'] = array(
     'title callback' => 'node_page_title',
     'title arguments' => array(1),
This entry was posted in Drupal and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *