Download & Extend

WSOD on node/add/<type> if capitalization on <type> is wrong.

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.

AttachmentSizeStatusTest resultOperations
node-add-wsod.patch743 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 24,796 pass(es).View details | Re-test

Comments

#1

Status:needs review» reviewed & tested by the community

works for me.

#2

Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks.

#3

Version:7.x-dev» 6.x-dev
Status:fixed» needs review
Issue tags:-needs backport to D6

Thanks guys - D6 patch attached.

AttachmentSizeStatusTest resultOperations
911980-wsod-add-node.patch770 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 911980-wsod-add-node.patch.View details | Re-test

#4

Status:needs review» needs work

The last submitted patch, 911980-wsod-add-node.patch, failed testing.

#5

Status:needs work» needs review

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

Status:needs review» needs work

The last submitted patch, 911980-wsod-add-node.patch, failed testing.

#9

Status:needs work» needs review

Re-rolled against 6.x.

AttachmentSizeStatusTest resultOperations
911980-WSOD-node-add.patch913 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 190 pass(es).View details | Re-test

#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

Status:needs review» reviewed & tested by the community

Patch in comment #9 works as advertised.

#12

Status:reviewed & tested by the community» needs work

Agreed with @joachim, please add a comment above the changed code explaining why are you doing this.