Posted by mr.baileys on September 15, 2010 at 6:53am
8 followers
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | node.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
| Issue tags: | Quick fix |
Issue Summary
This has been bugging me for a while since I prefer URL hacking over menu navigation when adding nodes: When visiting node/add/<type> using incorrect capitalization in the <type>, you'll get a WSOD caused by an undefined variable $output in node_add($type).
The following paths work as expected:
- node/add/page
- NoDe/AdD/page
- node/add/does-not-exist (correctly displays the list of available content types for which nodes can be added)
The following path causes a WSOD:
- node/add/PaGe (would expect to see either the node add page for "page" content type, or the list of available content types)
Given the fact that the rest of the path is treated as case insensitive, node/add/PAGE should show the "Create Page" node form.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| node-add-wsod.patch | 743 bytes | Idle | PASSED: [[SimpleTest]]: [MySQL] 24,796 pass(es). | View details | Re-test |
Comments
#1
works for me.
#2
Committed to CVS HEAD. Thanks.
#3
Thanks guys - D6 patch attached.
#4
The last submitted patch, 911980-wsod-add-node.patch, failed testing.
#5
silly bot, this is a D6 patch.
#6
Has this been fixed in the latest D6 release? I still encounter this problem
#7
#3: 911980-wsod-add-node.patch queued for re-testing.
#8
The last submitted patch, 911980-wsod-add-node.patch, failed testing.
#9
Re-rolled against 6.x.
#10
I think this could do with an inline comment, just to prevent a future developer thinking 'WTF?' and changing it back to the expected numerical value.
#11
Patch in comment #9 works as advertised.
#12
Agreed with @joachim, please add a comment above the changed code explaining why are you doing this.