To reproduce, go to ?q=admin/build/contact and create two categories with just the default options. Then go to ?q=contact, and notice that you have a notice... ha!

This patch should be easy to create for someone new to Drupal.

Comments

blackdog’s picture

Status: Active » Needs review
StatusFileSize
new687 bytes

Added an isset(), notice gone.

jody lynn’s picture

StatusFileSize
new861 bytes

New patch. Isset() returns a boolean so it will not work when there is an actual default_value to be set. This patch sets '--' as the default_value when there is none set.

blackdog’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new880 bytes

Better patch, applies well and does the trick. Fixed a minor spacing issue.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Well, I would use t('-Please select-') or something along those lines as a default category, just like in forum module for example. That gives a bit more information to the visitor on what should be done.

blackdog’s picture

StatusFileSize
new895 bytes

Updated the patch with the phrase '- Please choose -', like in the forum module.

jody lynn’s picture

Status: Needs work » Reviewed & tested by the community

Tested patch successfully.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new863 bytes

Great. I slightly modified the patch to omit the $placeholder variable which we don't require. This is less lines and cleaner. Committed this one. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.