Download & Extend

Problem with underscores in node types

Project:Workspace
Version:6.x-1.4-rc1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

When creating a node type, Drupal says: « Underscores will be converted into hyphens when constructing the URL of the create content page. »

But in the Workspace module, the "Add new item" form, just passes the $node_type without converting "underscores" into "hyphens". Resulting a blank page.

This patch corrects this issue. 1 line changed !

     if (isset($options[$node_type])) {
-      drupal_goto('node/add/' . $node_type);
+      drupal_goto('node/add/' . str_replace('_', '-', $node_type));
     }
AttachmentSize
workspace.patch448 bytes

Comments

#1

To be more precise...

The actual node add url with Workspace :
example.com/node/add/node_type [WRONG]

With this patch :
example.com/node/add/node-type [GOOD]

#2

Status:patch (to be ported)» closed (duplicate)

Duplicate of #344585: "Add new item" feature produces bad URLs for CCK content types. Please follow that thread, thanks.